Octave Lessons: Multiplot (different colours, subplot function, hold function)

preview_player
Показать описание
Option 1: Plot on same graph different colours
clear all, clc
x=linspace(0,10,5); %from 0 all the way to 10, and 5 columns
y1 = x.^3;
y2 = sin(x);
plot(x,y1, '-*r' , x,y2, '-+k' ) %y1 solid line, with stars, red, y2 cross, black line) title ('Plot Y1 and Y2')
legend ('y1', 'y2')
grid on
xlabel('x-axis')
ylabel('y-axis')

Option 2: Subplot function clear all
clear
clc
x=linspace(0,10,5); %from 0 all the way to 10, and 5 columns y1 = x.^3;
y2 = sin(x);
y3 = x.^2+2*x;

subplot(2,2,1),plot(x,y1,'-+g') % 2rows, two columns, position 1 %solid line style, vertical cross, green subplot(2,2,2),plot(x,y2, '^*r') % 2rows, two columns, position 2 %impulse line style, start marker, red subplot(2,2,3),plot(x,y2) % 2rows, two columns, position 3


Option 3: Hold on function
clear all,
clc
hold on
x=linspace(-2,0.1,5); %from 0 all the way to 10, and 5 columns y1 = x.^2+2*x;
plot(x,y1)
y2 = -x.^2-1; plot(x,y2)
legend ('y1', 'y2')

Octave Lessons / Tutorials:

Octave Lessons – Process Control

Coco Simulation:

DWSIM Simulation:

Reactor:

Transportation:

More Octave Lessons:

Channel:
-------------------------------------------------------------------------------------------------------------------------------------

Email any example you'd like for me to solve something similar of

Or comment your questions Thanks for watching next tricky problems / lessons that will broaden your knowledge are coming
----------------------------------------------------------------------------------------------------------------------------------------
More
Physics

Chemistry
Рекомендации по теме
welcome to shbcf.ru