Andrew's Octave Assignment: Difference between revisions

From Class Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
==Playing with Octave==
==Playing with Octave==


With this I made a simple plot with labels, a title, and a legend.
With this I made a simple plot with labels, a title, and a legend. Then I saved it as a png file.

[[File:Xplot.png|800px|thumb|right|Plot of the script Xplot.m]]


clear all
clear all
close all
close all
x=0:.1:10;
x=0:.1:10;
plot (x,x)
plot (x,x,'b-')
xlabel ('x label')
xlabel ('x label')
ylabel ('y label')
ylabel ('y label')
Line 20: Line 22:
grid on
grid on
legend ('y=x')
legend ('y=x')
print ('Xplot.png','-dpng');

Revision as of 15:32, 29 September 2010

Installing Octave

To install Octave, go to one of the computers in the computer lab and copy C:\Octave to a thumb drive. Then paste the Octave folder to your C:\ drive. This will save you at least 30 minutes and a headache.

The executable file is C:\Octave\3.2.3_gcc-4.4.0\bin\octave.exe

Octave does not have to be in the computer's registry. I am running octave from my thumb drive so I can have it on any computer I want.

Playing with Octave

With this I made a simple plot with labels, a title, and a legend. Then I saved it as a png file.

Plot of the script Xplot.m
clear all
close all
x=0:.1:10;
plot (x,x,'b-')
xlabel ('x label')
ylabel ('y label')
title ('title')
grid on
legend ('y=x')
print ('Xplot.png','-dpng');