How can I plot spectral data from 2 different day to compare 2 variables?

2 ビュー (過去 30 日間)
Hi I have a matrix with spectral data (attached the excel in zip format because is not uploading the excel) the first line is the wavelengths (variables) the first column is the day 1 and 2. the code I'm using is [d1 d2]=xlsread('path ... filename.xls'); then variable=d1(1,1:end); data=d1(2:end,:); day1=d2(1:6,1); day2=d2(7:18,:);
How can I plot or scatter, column 76 (for example) in the axe X against the column 100 in the axe Y of each day in the same plot? I'm trying to see both data groups in the same plot.

採用された回答

Pieter Hamming
Pieter Hamming 2018 年 6 月 21 日
Does this do what you need? If not, can you clarify the question?
[d1 d2]=xlsread('data2days.xlsx');
col1=76; %first column to be compared
col2=100; %second column to be compared
figure(1);clf(1);
scatter(d1(2:7,col1),d1(2:7,col2))
hold on
scatter(d1(8:end,col1),d1(8:end,col2))
legend('D1','D2')
  2 件のコメント
Claudio Ignacio Fernandez
Claudio Ignacio Fernandez 2018 年 6 月 21 日
Thanks, it really looks like what I'm looking for. I've been using Matlab for a week and only know how to plot things like plot (x,y). This kind of code is available in any tutorial? I really appreciate. Regards.
Pieter Hamming
Pieter Hamming 2018 年 6 月 22 日
I wouldn't know of a specific tutorial, but if you want some general matlab skills there's tons of tutorials around.
Whenever I need something specific I tend to Google "Matlab [something]" and more often than not, there's a Matlab function which does exactly what I need. I then use the awesome documentation ("doc ...") to figure out how to use it.
Hope this helps

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by