Introduction To Computing For Engineers: Cell Arrays and Examples
Introduction To Computing For Engineers: Cell Arrays and Examples
for Engineers
Cell Arrays and Examples
>>A=blue;
>>B=red;
>>C=green;
>> colors=[A; B; C];
??? Error using ==> vertcat
All rows in the bracketed expression must
have the same
number of columns.
>>A=blue;
>>B=red;
>>C=green;
>> colors=[A; B; C];
>> whos
Name
Size
A
1x4
B
1x3
C
1x5
Bytes Class
8 char array
6 char array
10 char array
>>A=blue;
>>B=red;
>>C=green;
>> colors=[A; B; C];
>> whos
Name
Size
A
1x4
B
1x3
C
1x5
Bytes Class
8 char array
6 char array
10 char array
Bytes Class
8 char array
6 char array
10 char array
204 cell array
and types.
>> A={string array, [1:.1:100],ones(100,100)}
>>A{1}=string array
>> A{2}=[1:.1:100];
>> A{3}=ones(100,100);
Programming Examples
1. Using a Matlab function file compute the value of pi using the following series
Programming Examples