How do you know that "p" has a dimension of 4 columns for the code given under "Body" herein below?

sim('focbls',[0 2]);
[p,f]=spectrum(posin,posfb,1024,0,[],1000);
figure(1)
clf;
subplot(211);
loglog(f,abs(p(:,4))),grid;

Answers (1)

You don't know what it has! It does not necessarily have four dimensions either, just four columns.
You can find out its size by asking:
size(p)
and if p does not have four columns the above would error.
p = magic(3);
p(:,4)

This question is closed.

Asked:

on 2 Jul 2012

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!