So why doesn't this work?

조회 수: 1 (최근 30일)
Wouter Stg
Wouter Stg 2015년 4월 10일
답변: A Jenkins 2015년 4월 10일
A simplified question for what im doing,
I've got variables
  • X :[1;2;3;4;5;6;7;8;9;10]
  • Y: magic(10)and i want to create Z,
Z= (number of x),Yvalue: (number of x),Y value) I tried this
y(x(1),3) which is the correct number i want.
y(x(4),3) which is also the correct number i want.
Now when i try Z= y(x(1),3): y(x(4),3)
I get
Columns 1 through 13
1 2 3 4 5 6 7 8 9 10 11 12 13
Columns 14 through 19
14 15 16 17 18 19
What am i doing wrong?
  댓글 수: 2
KL
KL 2015년 4월 10일
y(x(1),3) is 1 and y(x(4),3) is 19. So by Z= y(x(1),3): y(x(4),3) you mean Z = 1:19. I don't find anything surprising here. Can you explain what do you expect in Z?
Wouter Stg
Wouter Stg 2015년 4월 10일
편집: Wouter Stg 2015년 4월 10일
What i want in Z is
out of y for the rownumber the number in x (x1)and for
the columnnumber the collumn of y (y(:,3)???
and than a sequence of it from in the exaple 1-4)
I want in Z the sequence in y from collumn 3 in z) so
[1; 7; 88; 19;] is what i want in Z

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

채택된 답변

A Jenkins
A Jenkins 2015년 4월 10일
z=y(X(1):X(4),3)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Encryption / Cryptography에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by