A question about usage of ndgrid

2 views (last 30 days)
Vinod
Vinod on 19 Apr 2014
Commented: Vinod on 19 Apr 2014
Hello,
I am relatively new to MATLAB so would like to know if there is a way to invoke the ndgrid function with a set of values rather than a range, as specified in the documentation? For instance, if I had to plot five dimensions with five values like 0.5 0.3 0.675 0.987 0.1100, would I be able to do it with ndgrid? Alternatively, is there any other MATLAB function that could help me to generate a grid plot for n random data dimensions?
Greatly appreciate your thoughts.
TIA Vinod

Answers (1)

Walter Roberson
Walter Roberson on 19 Apr 2014
Yes, no problem. ndgrid does not ever really take ranges: the examples you look at are using operators that create sets of values from ranges and pass those sets into ndgrid.
[A, B, C, D, E] = ndgrid([0.5 0.3 0.675 0.987 0.1100]);
  3 Comments
Walter Roberson
Walter Roberson on 19 Apr 2014
How do you want the 4th and 5th dimensions to be represented on the plot? Use color for the 4th dimension, and time (animation) for the 5th dimension?
Vinod
Vinod on 19 Apr 2014
thanks. color should be fine, but animation may not be an option. The plots would be sent to a publication. Even I am not sure about color, as it may not appear on b/w printouts. is there any other way to bring to the fore all the dimensions without using either color or animation? I would prefer using directional coordinates if that is an option at all, but I also understand that then the plot might be restricted to 3 dimensions. I have already plotted something using surf(), but in this case I had to do away with certain aspects of the simulation results so as to reduce it to three dimensions.
Vinod

Sign in to comment.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!