Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>SCATTER3 requires <code>x</code>, <code>y</code> and <code>z</code> and other grouping arguments to be equally-sized Nx1 vectors for a single series or NxM matrices for M series. </p> <p>You have full space 3D data. To make equally-sized coordinate vectors use <a href="http://www.mathworks.com/help/techdoc/ref/meshgrid.html" rel="noreferrer">MESHGRID</a> (or <a href="http://www.mathworks.com/help/techdoc/ref/ndgrid.html" rel="noreferrer">NDGRID</a>) function:</p> <pre><code>[X, Y, Z] = meshgrid(t, y, a); </code></pre> <p>Then you can use SCATTER3:</p> <pre><code>scatter3( X(:), Y(:), Z(:), [], S(:) ) </code></pre> <p>The problem is since it's full space data scatter3 will not be helpful specially if you have a lot of points. </p> <p>You can probably filter your S variable (something like <code>idx = S &gt; 0</code>), then you can plot filtered data. </p> <p>If you really need to visualize all the data, look at <a href="http://www.mathworks.com/help/techdoc/visualize/f5-8666.html" rel="noreferrer">Volume visualization</a> in MATLAB documentation. I can recommend <a href="http://www.mathworks.com/help/techdoc/ref/slice.html" rel="noreferrer">SLICE</a> function, for example.</p> <p><strong>EDIT</strong></p> <p>Here is an example of full 3D space scatter plot for small vectors (<code>m</code>, <code>n</code>, <code>o</code> equal to 5) with <code>S = rand([m,n,o]); scatter3( X(:), Y(:), Z(:), [], S(:), 'filled' )</code></p> <p><img src="https://i.stack.imgur.com/gGb3q.png" alt="scatter example"></p> <p><strong>EDIT 2</strong></p> <p>From your comments to the other answer I found that you have 32x76050x4 matrix. You can actually plot 2D slice one at a time. you can do it in 2D with IMAGESC function, or in 3D with SLICE function.</p> <p>Try:</p> <pre><code>imagesc(S(:,:,k)) </code></pre> <p>where <code>k</code> is a number from 1 to 4 for the 3rd dimension.</p> <p>Or try </p> <pre><code>slice(S, [], [], 1:size(S,3)) shading flat </code></pre> <p><img src="https://i.stack.imgur.com/LzeAm.png" alt="slice example"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload