I have a 6 dimensional array with each dimension have 17 elements. Now I want to plot this array but don't know how. Can anyone please suggest a method to plot this array

3 件のコメント

Alessandro Masullo
Alessandro Masullo 2015 年 1 月 9 日
What do you mean by 6 dimensional array? Is it a 17*17*17*17*17*17 matrix?
Tanvir Ahmad
Tanvir Ahmad 2015 年 1 月 10 日
Yes it is a 17*17*17*17*17*17 matrix. I am working on some wind energy problems. Each dimension represents one wind turbine. Then I add all these powers to get the total power. The problem is a complex one. Therefore, I have to plot all the combinations of powers and the find the maximum. I have the combinations in this 6-D array, now I have to plot it somehow and then use some technique to find the maxima.
This problem in the future would have more turbines - means more dimensions
geekyGiraffe
geekyGiraffe 2017 年 6 月 21 日
function plotm works for 6 dimensional data

サインインしてコメントする。

 採用された回答

Zoltán Csáti
Zoltán Csáti 2015 年 1 月 10 日

0 投票

Plot like a multivariate function: by its level sets.

5 件のコメント

Tanvir Ahmad
Tanvir Ahmad 2015 年 1 月 10 日
Could you explain it a bit more please
Zoltán Csáti
Zoltán Csáti 2015 年 1 月 11 日
You can display a function of two variables. But what about a function of three variables. We cannot represent it like the former one. In that case we fix one variable (give it a certain value, call it c) and plot the remaining two the usual way. We can set different values of c and we get the so-called isosurfaces. This is what you do when you deal with a multivariate function. Let f(x1,x2,...,xn) be a function of n variables. You will fix n-2 (or n-1) variables and will plot it as f(x1,x2,c1,...,c_(n-2)). If you choose different values for c_i, you can represent the function as a surface.
Now turn to that 6D array. You can do it like this:
% Assume that X and Y are given. The correspond to x1 and x2
% and M is the 6D array.
mesh(X,Y,M(:,:,1,1,1,1);
% If you want to plot it in the third and fifth dimension:
mesh(1,1,:,1,:,1);
Tanvir Ahmad
Tanvir Ahmad 2015 年 1 月 14 日
Thank you. These are some very useful tips and solved most of my problem, except for one thing. When I try to plot the last two dimensions i.e. 5th and 6th like mesh(x,y,m(1,1,1,1,:,:)) then I get an error message that Z i.e. the last argument of mesh, must be a matrix, not a scalar or vector. Could you explain what's wrong with this one. I want to keep X and Y here as these variables show the scales of the plot. Could you explain it please.
Thank you again
Zoltán Csáti
Zoltán Csáti 2015 年 1 月 14 日
It is quite ambiguous for me to deal with arrays of more than 3 dimensions. I suggest you to use a cell array instead, in which every cell would contain a matrix representing a wind turbine.
arich82
arich82 2015 年 1 月 14 日
Try using the squeeze command:
mesh(x, y, squeeze(m(1,1,1,1,:,:)));

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by