Could anyone help me to solve on unused_rows=1:50

1 次查看(过去 30 天)
In my code i am using
unused_rows = 1:50
But when the command executes, it displays the result as shown in the attached image.
Actually it should display 1x50 double. Could anyone help me to solve this?
  2 个评论
ANKUR KUMAR
ANKUR KUMAR 2018-1-8
编辑:ANKUR KUMAR 2018-1-8
I am getting the correct answer. Just one line code and it will give the sequence up to 50. If your problem is not yet resolved, then clear all the variables and then run the code.

请先登录,再进行评论。

回答(1 个)

Rik
Rik 2018-1-8
If you look at the code in my answer, you will see that the vector unused_rows decreases in size every iteration. It is initialized based on m. If you change m, this vector will change as well. You can adapt my code to support a different number of rows by using unused_rows=1:size(B,1); instead.

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by