Set 'n' value by making matlab automatically calculate from a matrix
Show older comments
I have a matrix of XXXXXx1 and i want matlab to automtically calculate an even division of it and set it as a new value.
eg: i have a matrix of 10000x1 and i want matlab to divide it by a fixed number (eg 400) and give me the return value of n=25.
5 Comments
Rik
on 19 May 2018
You mean like this?
n=size(A,1)/fixed;
Hunyum Murya
on 19 May 2018
Jan
on 19 May 2018
I do not understand the question. Please clarify it.
Rik
on 19 May 2018
If A contains your vector of size 10000x1 and fixed is 400, then my line of code results in n being set to 25. If that is not what you mean, you should describe what it is you mean, preferably showing the code you tried.
Image Analyst
on 12 Jun 2018
Do you want to take 25 subsamples of the original vector? Again, please clarify.
Answers (0)
Categories
Find more on Elementary Math 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!