3D array becomes 4D Array
Mostra commenti meno recenti
Hi,
I use in matlab Simulink a matlab fcn blok to create a 3D array. That is the function:
function y = fcn()
X_welt=10;
Y_welt=10;
Z_welt=10;
welt = zeros(X_welt,Y_welt,Z_welt);
y = welt;
and I use additionally to workspace blok to load that into the matlab workspace. But the problem ist i get a 4D array val(:,:,1,1) =...
Why does it change the dimension???
THX
Risposte (1)
Jan
il 22 Lug 2013
A trailing dimension of 1 can always be appended in Matlab. This still replies the 2nd element:
x = rand(3, 1);
disp(x(2, 1, 1, 1, 1, 1, 1, 1))
So please explain what "i get a 4D array val(:,:,1,1) =..." exactly means. Please post the complete code you use to identify the problem.
3 Commenti
sia
il 22 Lug 2013
Jan
il 22 Lug 2013
Please do not post something, that is similar to what you get, but show us exactly what you get. What does size(val) return?
When you explain how you create this variable and how it is changed afterwards, we will find the reason for the results.
sia
il 23 Lug 2013
Categorie
Scopri di più su Array and Matrix Mathematics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!