Operator '-' is not supported for operands of type 'cell'.

I am having some problem with obtaining a calculation as it is followed by this error:
Operator '-' is not supported for operands of type 'cell'.
Error in Tumbledata_user (line 28)
VSFR=cos(radians)*((ATtable{1,3} - (ATtable{1,5}))/(2*Rs)) %Vertical readings-scale factor
Then try to perform the calculation: VSFR=cos(radians)*((ATtable{1,3} - (ATtable{1,5}))/(2*Rs)). I am subtracting certain values from the table.
I am wondering why I am receiving the error: Operator '-' is not supported for operands of type 'cell'. And how to resolve this issue.

 Réponse acceptée

Matt J
Matt J le 1 Juil 2020

1 vote

Check the contents of ATtable{1,3} and ATtable{1,5}. I bet they're not numbers.

4 commentaires

Matt J
Matt J le 1 Juil 2020
Well, attach ATtable in a .mat file and we can study it more closely.
Matt J
Matt J le 1 Juil 2020
Modifié(e) : Matt J le 1 Juil 2020
There are quotes around the contents of your table entries. A table containing numbers would just have numbers, like this:
If you are using a current release of MATLAB, you can do a detectImportOptions and then set the VariableOptions properties Prefixes and Suffixes to include the apostrophe, I think.
See: Position and extraction of row. We may have serendipitously solved this with str2double.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by