Determining the size of an array.

조회 수: 1 (최근 30일)
Tom
Tom 2013년 2월 27일
Hello, thanks for helping.
I want to create an piece within my code to analyze a user input... for example.. when the user inputs a word such as 'Hello', i want to beable to analyze the size of the array? so if anyone can point me in the right direction I will be very great full. i was thinking of using a while loop to keep searching for a letters withing the array but im not 100% sure if that will work, because i then need to use the size of the array to assign values to each character.
PS. i do apologize in my terminology as i am very new to Matlab, if you have any issues in what i have said please do ask and i will try to clarify what i mean. Many thanks for the help in advance!

답변 (1개)

Jan
Jan 2013년 2월 27일
S = 'hello'
disp(size(S))
  댓글 수: 3
Image Analyst
Image Analyst 2013년 2월 27일
sizeOfS = size(S);
letterE = S(2);
Jan
Jan 2013년 2월 27일
편집: Jan 2013년 2월 27일
@Tom: These questions are very basic. It is much more efficient, when you read the Getting Started chapters of the documentation, which explain the fundamental syntax and commands of Matlab exhaustively.

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

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by