if statement on cell
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Grigorios Kyritsakas
le 19 Juil 2018
Commenté : Grigorios Kyritsakas
le 19 Juil 2018
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 commentaires
Guillaume
le 19 Juil 2018
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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!