I have to create a poligonal graph and calculate its lenght, and this is the first step: evenly spacing the graph of the f = x^2 function. I wrote the code and it gives me just a blank plot. Here’s the code, I don’t know what’s wrong with it. I’d ble glad if someone helped me.
clc; clear all; close all; function [x, f] = exponencial(N) x = linspace(0, 1, N); f = x^2; end for N = 10 [x, f] = exponencial(N); plot(x, exponencial(N), '.-'); hold; end
- OS: e.g. Windows 10 (version 2004) or Ubuntu 20.04
- Octave version: e.g. Version 6.1.0
- Installation method: e.g. Downloaded and installed “octave-6.1.0-w64-installer.exe” from Download