I have very little experience with Octave, I made a code to plot 4 lines on a graph, it worked, but when I changed the name of the file and tried to run it I got "error: 'filename' undefined near line 1 column 1"
any of you guys know how to fix this?
>expecting us to debug your code without posting said code
>>7639558
sorry, completly forgot:
clc;
x = -3.1415:0.1:3.1415; %limits for x coordinates
a = sin(x) %defining a
b = x %defining b
c = x - ((x.^2)/2) %defining c
d = x - ((x.^2)/2) + ((x.^4)/24) %defining d
plot (x,a, 'r')
hold on;
plot (x,b, 'b')
hold on;
plot (x,c, 'g')
hold on;
plot (x,d, 'y')
hold off;
legend ('y=sin(x)', 'y=x', 'x-x^2/2', 'x-x^2/2 + x^4/24')
>>7639587
how are you calling the file?
>>7639602
MulvihillQ2.m it's a format I have to use
>>7639605
so are you typing the new filename at the command prompt and it doesn't run? or calling it within the Octave interpreter?
or are you running a script in Octave, and inside that script there's a call to run the script file containing the code given in this thread?
>>7639609
Running it through octave like this
>>7639612
then getting this when I try to run it
>>7639619
did you try running it with the *.m attachment indicated?
other than that that's weird. no fucking clue man
>>7639660
yeah, oh well, ill just have to get on with it, the code actually works, but it wont recognise it any more
>>7639696
oh, one last question
is it defined as a function inside the file, or just as a simple script?
if it's structured as a function, that's why it won't work
>>7639546
tell me what the "clc;" line does.
clear the screen, its a legit command
>>7639587
try adding
>function [] = Mulvihill()
at line 1
and
>endfunction
at the bottom