Info
此问题已关闭。 请重新打开它进行编辑或回答。
Is there no one with the knowledge of cell operation :(
1 次查看(过去 30 天)
显示 更早的评论
Hi. i have been asking this question again and again..with no real answer to it..it is supposed to be simple operation. but matlab is disappointing me now.
I have data in 1 cell. i want the values greater than 230 to be moved or copied into another cell. see pic.

so values at V{:,2} is 231,06 and is greater than 230, so with a code it should be moved or copied to next column.
a simple for loop or if ?
suggestions or help please?
0 个评论
回答(1 个)
Sean de Wolski
2014-3-18
编辑:Sean de Wolski
2014-3-18
First, you asked the first question on here just a few hours ago. Contributors on this page are unpaid volunteers so it cannot be expected to get an answer immediately.
However, good job clarifying your question with the image!
C = {'hello world';245;220};
isAbove230 = @(x)isnumeric(x) && x>230; % define a function to identify elements above 230
idx = cellfun(isAbove230,C); % where are they?
C(idx) = []; % remove offending elements
Or to make a copy
C230 = C(idx);
5 个评论
Walter Roberson
2014-3-18
I am not convinced that the entries are numeric; I think maybe they are all strings.
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!