How to create matrices from a meshgrid function

1 view (last 30 days)
'The scatter3 plot needs vectors, not matrices, but you can do that easily enough by using meshgrid to create the matrices and then creating vectors from them as RA(:), DEC(:) and A(:).'

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 23 Jun 2015
Edited: Azzi Abdelmalek on 23 Jun 2015
a=1:0.1:10
b=1:0.1:10
[A,B]=meshgrid(a,b)
C=sin(A).*cos(B) % Example
scatter3(A(:),B(:),C(:))
  3 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!