How come when i generated this command x=[-2:0.1:3] although the value does show but why on top there is (e.g columns 46 through 51 is there anyway to remove it?)

조회 수: 2 (최근 30일)
x=[-2:0.1:3]
x =
Columns 1 through 15
-2.0000 -1.9000 -1.8000 -1.7000 -1.6000 -1.5000 -1.4000 -1.3000 -1.2000 -1.1000 -1.0000 -0.9000 -0.8000 -0.7000 -0.6000
Columns 16 through 30
-0.5000 -0.4000 -0.3000 -0.2000 -0.1000 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000
Columns 31 through 45
1.0000 1.1000 1.2000 1.3000 1.4000 1.5000 1.6000 1.7000 1.8000 1.9000 2.0000 2.1000 2.2000 2.3000 2.4000
Columns 46 through 51
2.5000 2.6000 2.7000 2.8000 2.9000 3.0000

답변 (1개)

Guillaume
Guillaume 2018년 9월 4일
No, this is the way matlab displays vector/matrices on the command line and there is no option to change that. More importantly, why do you care? It's only cosmetics.
Talking of extra clutter, the [] around your -2:0.1:3 are totally unnecessary.
x = -2:0.1:3
would achieve the same.
  댓글 수: 3
Guillaume
Guillaume 2018년 9월 4일
1) How is this related to your original question?
2)Learn the difference between matrix and array operations. I suspect you want:
y = (x+2).*(x.^2+3)
melissa tan
melissa tan 2018년 9월 4일
i am trying to generate a graph with the previous range and stepsize . Can i also check how to change a range of my plotted graph ?

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by