how to create a border using cell arrays

조회 수: 1 (최근 30일)
Mitchie Teotico
Mitchie Teotico 2020년 3월 27일
댓글: Adam Danz 2020년 3월 27일
I am trying to create a function that inputs a number of rows (float,scalar) number of columns
(float scalar) and a character to be used for the border of a card the function should then
set up the blank flash cards and outputs it into a cell array the function then sets up the
blank flash cards and outputs it in a cell array (Nx1) like the one shown bellow.
im given the format and how the output should look like but i dont know how what to put in
the middle so that it outputs a border.
c = blankCard(5,5,*)
c = {
[1,1] = *****
[1,2] = * *
[1,3] = * *
[1,4] = * *
[1,5] = *****
}
  댓글 수: 1
Adam Danz
Adam Danz 2020년 3월 27일
The question describes an Nx1 cell array but the example shows a 1XN cell array if I'm interpretting the indices correctly.
More importantly, the cell would not display like the example in your question.
% Create the array
c = {
{'*****'};
{'* *'};
{'* *'};
{'* *'};
{'*****'};
};
size(c)
% ans =
% 5 1
% Display C
>> c
% c =
% 5×1 cell array
% {1×1 cell}
% {1×1 cell}
% {1×1 cell}
% {1×1 cell}
% {1×1 cell}
% Display cell content
>> celldisp(c)
% c{1}{1} =
% *****
% c{2}{1} =
% * *
% c{3}{1} =
% * *
% c{4}{1} =
% * *
% c{5}{1} =
% *****

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by