What is the best way to create pcolor plot in the case when 1d-arrays given?
19 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Attskij Sotona
am 3 Mär. 2020
Kommentiert: Attskij Sotona
am 7 Mär. 2020
Hello community. Could you provide an example for pcolor plot, if my dataset is described like this:
x=getSomeX(); % returns 1-by-n vector, in general just random doubles without any sequence
y=getSomeY(x); % returns 1-by-n vector
z=getSomeZ(x); % returns 1-by-n vector
where n is constant length, and i want to do something like this
pcolor(x,y,z);
but for me the problem is to make a correct n-by-n matrix z.
Thanks!
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 4 Mär. 2020
You cannot directly create pcolor plots in that situation. Instead see griddedInterpolant() https://www.mathworks.com/help/matlab/ref/griddedinterpolant.html or scatteredInterpolant() . Once you have the interpolated data, you can pcolor() that.
3 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Colormaps finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!