how can i draw a 2 columns (as a time first raw is from 0 to 20 this in x axis and in y axis is from the 3rd column) and the 3rd is category

3 ビュー (過去 30 日間)
, *note*(y axis is only three values(sil,Tr, NTr) and are repeated randomly)
as follow data:

採用された回答

KSSV
KSSV 2020 年 6 月 17 日
編集済み: KSSV 2020 年 6 月 17 日
% Read the file
file = "ex3data.txt" ;
fid = fopen(file,'r') ;
S = textscan(fid,'%f %f %s') ;
fclose(fid) ;
% Seperate each data
S1 = S{:,1} ;
S2 = S{:,2} ;
S3 = S{:,3} ;
str = unique(S3) ;
C = {'r', 'g','b'} ;
for i = 1:length(str)
idx = strcmp(S3,str{i}) ;
bar(idx*i,'facecolor',C{i})
hold on
end
legend(str)
You can explore the other plotting options.
  2 件のコメント
Manar Gbaily
Manar Gbaily 2020 年 6 月 18 日
thanks so much but i need to know how you set the amplitude and i need to change it please of(sil=0.5, NTr=1, Tr=1)
and how you eleminate the numbers of column 1 and 2
many thanks again
Manar Gbaily
Manar Gbaily 2020 年 6 月 18 日
編集済み: Manar Gbaily 2020 年 6 月 18 日
this is input and after each (.) its a new data put it in new figure
"*/Sp110101.lab" this is file name i need to draw each file in a figure
0 200000 sil -49.119217 (this is the first raw in the file i need to draw 0 200000 sil without -49.119217)
and thanks

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by