[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Octave
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /sci/ - Science & Math

Thread replies: 14
Thread images: 3
File: octave.png (10 KB, 200x200) Image search: [Google]
octave.png
10 KB, 200x200
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?
>>
File: OCTAVE1.png (85 KB, 1056x790) Image search: [Google]
OCTAVE1.png
85 KB, 1056x790
>>7639609
Running it through octave like this
>>
File: OCTAVE2.png (55 KB, 1048x760) Image search: [Google]
OCTAVE2.png
55 KB, 1048x760
>>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
Thread replies: 14
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.