Need all row data after strcmp
Show older comments
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 Comments
Githin George
on 22 Jul 2022
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
on 22 Jul 2022
Edited: Santosh Biradar
on 22 Jul 2022
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
on 23 Jul 2022
Jan
on 23 Jul 2022
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.
Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!