Hello!
I am trying to plot all the Y-values from the for loop but it seems that I recieve a new Y-value from every itterations. I think that when plotting, I only plot ONE Y-value. not all of them. I believe saving all the Y-values into a array would make it possible to plot X,Y. How can I save the Y-values? Or is there any other way to plot my data?
clear all
close all
clc
Mmax=10.76; %Maximum mass
Mmin=10.32; %Minimum mass
Mdiff=0.44; %Mass difference
UptakeW=(Mdiff/Mmin); %In percentage
A=load('MMC#8-PURE_TGA-Heated_Samples_05102020.txt');
B=A(2735:4823,5);
X=0:0.1:50;
for i=0:0.01:Mdiff
Y=((i)./Mdiff)*100
end
plot(X,Y)

 採用された回答

KSSV
KSSV 2020 年 10 月 6 日
編集済み: KSSV 2020 年 10 月 6 日

0 投票

clear all
close all
clc
Mmax=10.76; %Maximum mass
Mmin=10.32; %Minimum mass
Mdiff=0.44; %Mass difference
UptakeW=(Mdiff/Mmin); %In percentage
A=load('MMC#8-PURE_TGA-Heated_Samples_05102020.txt');
B=A(2735:4823,5);
X=0:0.1:50;
XX = 0:0.01:Mdiff ;
Y = zeros(size(XX)) ;
for i=1:length(XX) ;
Y(i)=(XX(i)./Mdiff)*100
end
plot(XX,Y)
No loop required actually:
clear all
close all
clc
Mmax=10.76; %Maximum mass
Mmin=10.32; %Minimum mass
Mdiff=0.44; %Mass difference
UptakeW=(Mdiff/Mmin); %In percentage
A=load('MMC#8-PURE_TGA-Heated_Samples_05102020.txt');
B=A(2735:4823,5);
X=0:0.1:50;
XX = 0:0.01:Mdiff ;
Y = XX/Mdiff*100 ;
plot(XX,Y)

1 件のコメント

Abbas Jafari
Abbas Jafari 2020 年 10 月 9 日
Thank you! You really did help me out :D

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraphics Performance についてさらに検索

質問済み:

2020 年 10 月 6 日

コメント済み:

2020 年 10 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by