Filter löschen
Filter löschen

2D Graph Map

1 Ansicht (letzte 30 Tage)
Federico Galdenzi
Federico Galdenzi am 3 Feb. 2018
Beantwortet: Prajit T R am 8 Feb. 2018
Good afternoon. I have to do a graphic where the x,y data are the temperature and the energy, and the z is the intensity of a signal at that temperature/energy point. Problem is, i don't know how to do it properly becouse the three vectors don't have the same lenght.

Antworten (1)

Prajit T R
Prajit T R am 8 Feb. 2018
Hi Federico,
I understand that you are trying to plot a graph with three vectors x,y and z with different lengths. As far as I know, the usage of the ‘plot’ function or ‘surf’ function is not supported when you have vectors with differing lengths.
I can suggest two possible workarounds for this:
  1. If your data is consistent and you know where some data for a variable is missing, try using interpolation functions (‘interp1’ or ‘interp2’ as per your requirement) which would help you to fill in the missing values and make the vectors to be of equal length.
  2. Fill the missing data points with ‘NaN’ to make the vectors of equal length and then plot it.
I hope this workaround helps.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by