- %age of number of elements in matrix --> x(1:round(0.85*numel(x)))
- elements within %age of max in matrix--> x(x<=0.85*max(x(:)))
Index a percentage of a Matrix
3 次查看(过去 30 天)
显示 更早的评论
I'm trying to extract the first 85% of one matrix and the last 15% of another to enable me to plot the combustion of non regular shaped solid fuels but haven't been able to so far.
0 个评论
回答(1 个)
dpb
2016-11-28
85% of what--the indices, the values, ...? And, if it's is a matrix, what about shape? Matter where they came from or just overall, or...????
Anyway,
Other logical direction readily extensible from above.
2 个评论
dpb
2016-11-30
[OP Answer moved to Comment -- dpb]
Sorry they are single line matrices. Lengths will change depending of the fidelity that I require.
dpb
2016-11-30
编辑:dpb
2016-11-30
" depending of the fidelity that I require."
What does that mean? Still don't say what it is that you mean by percentage. Give an example (minimally sized) input and an expected output and the rule(z) by which you decide that's the right answer...otherwise, what's wrong with the above?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!