필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Simple Question: Taking Some Elements of Variables Based on Number

조회 수: 1 (최근 30일)
Berk Demir
Berk Demir 2020년 4월 24일
마감: MATLAB Answer Bot 2021년 8월 20일
Bx is an array. Size is 6x1.
When I want two rows of members from that, it gives me as it should. If I ask only one row, it gives as second one. Isn't that wrong? Am I doing something wrong? Since I have based my code to the first type, due to second type of output I got errors
K>> B_x([1 2;3 4])
ans =
-25 -24
-23 -22
K>> B_x([1 2])
ans =
-25
-24
  댓글 수: 2
Tommy
Tommy 2020년 4월 24일
When you call B_x([1 2]), even though the indices are a row vector, you get a column vector because B_x is a column vector.
Berk Demir
Berk Demir 2020년 4월 24일
편집: Berk Demir 2020년 4월 24일
That's OK. But why I get 25 and 24 as row vector in the first instance? In my mind it is just one less row in the second instance. The same type answer should be given to me.

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by