3D volume in a single variable of dimensions
Show older comments
Hello everyone!
I ran into an issue while trying to code data into a 3D volume in a single variable of dimensions. For example lets say I have data on Excel totaling 25 points spread in a 5x5 manner. How can assign x to it as a 3D volume? I understand it would be something like x(:,1,1)=[ the data copied from excel] however I have issue with the numbers in the parentheses with mismatch dimensions. Can anyone explain the correct way of doing this? Thank you!
Answers (1)
bym
on 2 Apr 2011
how about
x(:,:,1) = [the data copied from excel]
1 Comment
Walter Roberson
on 3 Apr 2011
Hard to say. If Y is the data copied from Excel, then maybe Dario wants
x(:,1,1) = Y(:);
Or maybe not. Maybe Dario wants
N3 = ceil(numels(Y) ^ (1/3));
x = zeros(N3,N3,N3);
x(1:numel(Y)) = Y(:);
Or something else.
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!