conversion of single data type to double
Afficher commentaires plus anciens
please what is the best way to represent a real time single data type 10x6 to double?
S = double(Real-TData);
SLength=length(S);
representing it this way doesnt work.
8 commentaires
Ameer Hamza
le 14 Mar 2020
What does not work? What are the classes of Real and TData?
Walter Roberson
le 14 Mar 2020
length(S) of a non-empty array S is max(size(S)) -- the length of the longest dimension, not any particular dimension. It is often a mistake to be asking about length() of a 2D array, and size() should be asked for instead.
Odesanmi Gbenga Abiodun
le 14 Mar 2020
dpb
le 14 Mar 2020
We can't tell what you're trying to do from descriptions and limited code, sorry.
What does
whos Real TData
return?
And, give us a sample small set of the data and/or show us what the inputs and then the expected outputs are.
By any chance, since talk of a "10x6 double" and have the T in the variable this wouldn't be an array of [year,month,day,hour,minute,second] data by any chance and Q? has to do with converting to a time variable?
Odesanmi Gbenga Abiodun
le 14 Mar 2020
dpb
le 14 Mar 2020
How did you generate a name 'Real-TData'? That's a math operator '-' in there.
That aside, you didn't answer the rest of the question posed which is to also show us some data values and what you want as an answer. Certainly double() would convert a single-precision argument to double-precision but somehow that doesn't seem to be the underlying problem here.
Odesanmi Gbenga Abiodun
le 15 Mar 2020
Guillaume
le 15 Mar 2020
We still don't know what you're asking and what you've shown so far raises a number of questions:
- What are you trying to do?
- In what way, what you tried doesn't work? If you get an error give us the full text of the error message
- How can you have a variable named Real-TData which is not a valid variable name in matlab
In addition, you show that the variable is global. global variables are a bad idea and the source of many problems.
Réponses (0)
Catégories
En savoir plus sur Cell Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!