plotting mx+c from a cell within a table

조회 수: 3 (최근 30일)
Nathan Rivard
Nathan Rivard 2019년 10월 30일
답변: Maadhav Akula 2019년 11월 6일
I am attempting to plot multiple equations on a single plot in y=mx+c form. The equations are already located within a central table called Gal50KBTUEquationComparison. I have no idea how to pull all of the equations seperately into matlab and compare them on the same plot. Below is my code
x = linspace(0,15,50);
y = Gal50KBTUEquationComparison{1};
plot(x,y);
ylim([0, 120]);
xlim([0 inf]);

답변 (1개)

Maadhav Akula
Maadhav Akula 2019년 11월 6일
First extract the required data from the given table(Gal50KBTUEquationComparison) as follows :
y1 = table2array(Gal50KBTUEquationComparison(1,1));
and for plotting all of the plots on a single plot, you can use the following:
plot(x,y1,x,y2,);
The following links might be helpful:

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by