Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Changing voxel dimesions to create a matrix
Replies: 1   Last Post: Sep 25, 2013 10:07 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 17,945
Registered: 12/7/04
Re: Changing voxel dimesions to create a matrix
Posted: Sep 25, 2013 10:07 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Marcos Belmonte" <marcosbelm@gmail.com> wrote in message
> Hi, I need to create an anisotropic matrix, with axes relations
> 0.4:0.4:1(z axis), how could I change the voxel size or take into account
> that my voxels are prisms insted of cubes, when I create a matrix?

Matrices in MATLAB are rectangular, and arrays are hyperrectangular; you
can't have matrices whose rows have different number of elements or anything
like that.


If you want to _visualize_ your matrix such that the elements are not the
same size, that's possible.

>> [x, y] = meshgrid(-2:0.1:2);
>> figure; surf(x, y, ones(size(x)))
>> figure; surf(x.*abs(x), y, ones(size(x)))
>> figure; surf(x.*abs(x), y.*abs(y), ones(size(x)))

You can even make nonrectangular elements.

>> [x, y] = meshgrid(-2:2);
>> x(2, 2) = -1.5;
>> y(2, 2) = -1.5;
>> surf(x, y, ones(size(x)))
>> view(2)

For elements that are not 4-sided, you'd need to go to PATCH rather than

Steve Lord
To contact Technical Support use the Contact Us link on

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.