필터 지우기
필터 지우기

how to use cells arrays and loops

조회 수: 1 (최근 30일)
john calzone
john calzone 2014년 3월 25일
답변: Image Analyst 2014년 3월 26일
Write a script that will create and display a cell array; it will loop to store strings of lengths 1, 2, 3, and 4. The script will prompt the user for the strings. It will error-check, and print an error message and repeat the prompt if the user enters a string with an incorrect length.
I have the cell written as
cell1=('1' ; '22' ; '333' ; '444')
im new to Matlab clearly, and am truly stuck where to go from here. thank you
  댓글 수: 1
dpb
dpb 2014년 3월 26일
Well, you can surely make more of an attempt at it than that...but it doesn't really meet the requirement of "will loop to store strings..." nor to obtain them from the user as you've just stuffed them in.
Surely there's been more to the lecture before.

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

답변 (2개)

Joseph Cheng
Joseph Cheng 2014년 3월 26일
You'll want to look up the documentation for input and while. Those should get you started.

Image Analyst
Image Analyst 2014년 3월 26일
Have you read the FAQ for a good intuitive explanation of cell arrays: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by