Need all row data after strcmp
显示 更早的评论
try
in = 'AAA';
p = strcmp(in,raw);
if p >= 0
xlswrite('SummaryResult.xlsx',raw1(p),'AAA','A2')
else
0;
end
end
Once I will compare
I want all the row data where AAA is presnt in those column.
Please let me know for brief.
5 个评论
Githin George
2022-7-22
Hi Santosh,
Can you provide an example of a table and the result you expect.
Also if it helps you can take look at the code below. In this line I am filtering all the rows of a table having value in Col1 = 'AAA'.
filteredTable = tab(tab.Col1 == "AAA",:)
Santosh Biradar
2022-7-22
编辑:Santosh Biradar
2022-7-22
An Excel file is less useful, because you can import it in different ways. Please post some code, which produces the inout data or a MAT file.
What is the purpose of the line "if p >= 0"? p is a logical array. Do you mean:
if any(p(:))
What is raw1 and raw?
This line is useless - omit it:
0;
Santosh Biradar
2022-7-23
Jan
2022-7-23
I asked you, what the purpose of "if p >= 0" is. You did not answer this, but post the new line: "if (p(:))". Agaion the purpose is unclear. Do you mean:
if any(p(:))
Do you see, that your can format code in the forum? Please use the corresponding tools.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!