How can I fit a mesh plot axis to a vector of time values?

조회 수: 2 (최근 30일)
David Redondo Viñolo
David Redondo Viñolo 2020년 11월 14일
댓글: David Redondo Viñolo 2020년 11월 20일
I want to plot a mesh for some matrices that store voltage values for different temperatures in its columns and for different times of the simulation in its rows. The problem is that my time delta is not always 1s, it's less and the mesh plot shows the indices of the row instead of the actual time values (which are stored in a vector). Same thing with temperatures, although I'm using a 1ºC delta, this could not be always the case, and I would like to know how to map the x and y values of the mesh to the real ones stored in vectors. Also, can I use some kind of time series for the time axis in a mesh?

답변 (1개)

Peter Perkins
Peter Perkins 2020년 11월 19일
Does this not do what you need?
>> d = datetime(2020,11,1:20);
>> t = 1:15;
>> mesh(d,t,x)
Those dates and temps are evenly-spaced, but they needn't be.
  댓글 수: 1
David Redondo Viñolo
David Redondo Viñolo 2020년 11월 20일
No, because my data is stored in a single matrix.
>> data = ones(length(time), length(temperatures))
>> mesh(data)
If there is a more convinient way to approach this plot please tell me, because my program simulates voltages for a given time vector and temperature value, and I'm storing that in a matrix because I don't know how else could I plot this.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by