hello, please help
i have problem to plot a data excel to matlab. how i can fix it?

6 件のコメント

darova
darova 2020 年 2 月 20 日
Please post your code and data
Rik
Rik 2020 年 2 月 20 日
Have a read here and here. It will greatly improve your chances of getting an answer.
joni nababan
joni nababan 2020 年 2 月 20 日
this is the code :
try
[filename,path] = uigetfile('.xlsx')
dataExcel = xlsread(fullfile(path,filename))
try
global data;
global penghasilan;
global skor;
penghasilan = dataExcel(1:size(dataExcel,1),4)
skor = dataExcel(1:size(dataExcel,1),5)
cla
axes(handles.axes1)
plot(4:size(dataExcel,4),penghasilan,'-b.','markers',20)
grid on
legend('Data Mahasiswa')
xlabel('Mahasiswa'), ylabel('IPK')
set(gca,'xtick',0:30:size(penghasilan))
set(gca,'XtickLabel',0:30:size(penghasilan))
set(gca, 'FontSize', 6)
axes(handles.axes2)
plot(1:size(dataExcel,1)-107,skor,'-b.','markers',20)
grid on
legend('Data Mahasiswa')
xlabel('Mahasiswa'), ylabel('Skor Point')
set(gca,'xtick',0:30:size(skor))
set(gca,'XtickLabel',0:30:size(skor))
set(gca, 'FontSize', 6)
catch
msgbox({'Type data is not valid!!!';'Please insert the correct type data'})
end
catch
msgbox('insert the data')
end
please help
Adam
Adam 2020 年 2 月 20 日
編集済み: Adam 2020 年 2 月 20 日
If you want help with a problem please put at least a little thought into the basics of asking a question! You had to be asked to post the code and you also haven't said what the problem is. People are not mind readers. If you have a problem you need help with the fastest way to get that is to give the people who would help you all the information available.
Jon
Jon 2020 年 2 月 20 日
Please explain what problem you are experiencing when you try to run your code. Also, if you select your code and the click the code button on the MATLAB Answers toolbar it will format nicely.
joni nababan
joni nababan 2020 年 2 月 24 日
my problem is to make a graph of the data that is in excel

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

 採用された回答

darova
darova 2020 年 2 月 20 日

0 投票

I corrected your script. Try now
[filename,path] = uigetfile('.xlsx')
dataExcel = xlsread(fullfile(path,filename))
penghasilan = dataExcel(:,4); % no need: 1:size(dataExcel,1)
skor = dataExcel(:,5);
plot(penghasilan,skor)

4 件のコメント

joni nababan
joni nababan 2020 年 2 月 24 日
what's the fucntion from size?
darova
darova 2020 年 2 月 24 日
YOu mean colon (:)?
joni nababan
joni nababan 2020 年 2 月 24 日
yes
Adam
Adam 2020 年 2 月 24 日
doc colon

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

その他の回答 (0 件)

質問済み:

2020 年 2 月 20 日

コメント済み:

2020 年 2 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by