'summary' function for a cell
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
summary function provides a summary of a content of a table
Then what is a function to summarize the information of a cell?
채택된 답변
madhan ravi
2020년 12월 19일
help cell2table
CELL2TABLE Convert cell array to table.
T = CELL2TABLE(C) converts the M-by-N cell array C to an M-by-N table T.
CELL2TABLE vertically concatenates the contents of the cells in each column
of C to create each variable in T, with one exception: if a column of C
contains character vectors, then the corresponding variable in T is a
cell array of character vectors.
T = CELL2TABLE(C, 'PARAM1', VAL1, 'PARAM2', VAL2, ...) specifies optional
parameter name/value pairs that determine how the data in C are converted.
'VariableNames' A string array or cell array of character vectors
containing variable names for T. The names must be
valid MATLAB identifiers, and must be unique.
'RowNames' A string array or cell array of character vectors
containing row names for T. The names need not be
valid MATLAB identifiers, but must be unique.
See also TABLE2CELL, ARRAY2TABLE, STRUCT2TABLE, TABLE.
Documentation for cell2table
doc cell2table
댓글 수: 7
alpedhuez
2020년 12월 19일
Yes but looking for information for the cell so that one can use this information to manipulate the cell later
Image Analyst
2020년 12월 19일
I don't believe there is such a function, and anyway, you don't need one to manipulate the cell array later. What you do need is knowledge of what you placed into each cell. And try to avoid cell arrays if you can. Use numerical arrays, tables, or structure arrays if you can, rather than a cell array.
alpedhuez
2020년 12월 19일
I would say there should be such one that will help people to visualize what they are doing.
alpedhuez
2020년 12월 20일
"Cell arrays contain data in cells that you access by numeric indexing. Common applications of cell arrays include storing separate pieces of text and storing heterogeneous data from spreadsheets."
I have data for cities and put a data for each city in a cell. Will structural array work better in this kind of situation?
Steven Lord
2020년 12월 20일
If you feel there should be a function similar in functionality to summary but for cell arrays, I recommend you send this enhancement request to Technical Support using the Contact Support link on the Support section of the MathWorks website. Please include in your enhancement request what aspects of the summary for table and timetable arrays you would find useful in a cell version, as well as sharing information about how you would plan to use it if it existed.
Hi
Good time
I wrote this code but it gives an error
Please help me
thank you
n=100;
u1=[0,0]';
X1=[-4,-2,0]';
% p=data.PredictionHorizon;
a=0.9;h=0.9;
cp1=1;cp2=1;cp3=1;
% c1=0;c2=0;c3=0;
for j=1:n
c1(j)=(1-(1+a)/j)*cp1;
c2(j)=(1-(1+a)/j)*cp2;
c3(j)=(1-(1+a)/j)*cp3;
cp1=c1(j); cp2=c2(j); cp3=c3(j);
end
% initial conditions setting:
v1(1)=u1(1);
w1(1)=u1(2);
x1(1)=X1(1); y1(1)=X1(2); z1(1)=X1(3);
% calculation of phase portraits /numerical solution/:
for i=2:n
x1(i)=h*cos(z1(i-1))*v1(i-1) - memo(x1, c1, i);
y1(i)=h*sin(z1(i-1))*v1(i-1)-memo(y1, c2, i);
z1(i)=h*w1(i-1)-memo(z1, c3, i) ;
end
%%
function [yo] = memo(r, c, k)
%
temp = 0;
for j=1:k-1
temp = temp + c(j)*r(k-j);
end
yo = temp;
%
%%%%% error
Index exceeds the number of array elements (1).
Error in exocstrstateFcnCT1 (line 28)
x1(i)=h*cos(z1(i-1))*v1(i-1) - memo(x1, c1, i);
Walter Roberson
2020년 12월 23일
You only initialize v1(1) so you have a problem when i = 3 because then you need v1(3-1) -> v1(2)
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
태그
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
