if statement on cell
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a matrix A with 3 columns. The first column contains letters (specific reference numbers) and the other two columns contain numbers (values). I also have a big table B that contains also the first column of the matrix A but its length is bigger than A's as some reference numbers are repeated. I want to add two extra columns in table B where for each reference number I get the corresponding to the reference number values of the matrix A. I tried to use the if function but it didn't work (as reference numbers are cells) and isequal is not working as the first column in A has less rows than the columns of table B. Can anyone help me with this?
3 个评论
Guillaume
2018-7-19
Or if the matrices were converted to tables, which sound better suited for what they contain, a single call to join would do the job.
But yes, an example of the inputs is required, particularly since matrices cannot contain both text and numbers, so it's unknown what A and B actually are.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!