Filter löschen
Filter löschen

How to do a line plot with four variables?

1 Ansicht (letzte 30 Tage)
Gargi
Gargi am 15 Aug. 2015
Kommentiert: Gargi am 15 Aug. 2015
I have four variables in excel sheet , time, temp, lat and lon. I have to plot temperature data (which is on different grids i.e. lat, lon as in excel sheet). I want to take number of grids longitude 1 to 144 and latitude 1 to 73. And on this grid I have to plot temp data. I am not so perfect in MATLab. I have tried a lot but I am not getting how to do it. I've tried some commands like geoshow, load topo, m_map , but not succeeded. Kindly, help me. I've attached the excel sheet with this.
Thanks and Regards

Akzeptierte Antwort

Image Analyst
Image Analyst am 15 Aug. 2015
I'm not sure how you want to handle the year (column 1), but this is what I have so far:
[numbers, txt, raw] = xlsread('book1.xls');
temp = numbers(:, 2);
x = numbers(:, 3);
y = numbers(:, 4);
% Create an image
myTempImage = zeros(max(y), max(x));
for row = 1 : length(x)
% Assign temperature at row y, column x:
myTempImage(y(row), x(row)) = temp(row);
end
imshow(myTempImage, [], 'InitialMagnification', 1600);
axis on;
myColorMap = jet(256);
myColorMap(1,:) = [0,0,0];
colormap(myColorMap);
colorbar;
  1 Kommentar
Gargi
Gargi am 15 Aug. 2015
Thanku...its working....no problem...will try to do how to show years in plot....thanks a lot....!!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by