how to convert 1x2 double into two 1x1
19 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
flashpode
am 23 Okt. 2021
Kommentiert: flashpode
am 25 Okt. 2021
Hi I was coding when I had this error:
Time_msg_match = string(Time_msg_match);
Error using string
Conversion from cell failed. Element 61649 must be convertible to a string scalar.
>> Time_msg_match(61649)
ans =
1×1 cell array
{2×1 double}
How can I concadenate this 2x1 double?
I wrote:
Time_msg_match1 = num2str(cat(1, Time_msg_match{:}));
But the result is not what I wanted. Thanks in advance
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 23 Okt. 2021
Try this to create 2 separate variables out of that 1x2 cell array
Time_msg_match1 = Time_msg_match{1};
Time_msg_match2 = Time_msg_match{2};
6 Kommentare
Weitere Antworten (1)
Rik
am 23 Okt. 2021
It looks like this is what you want:
x=Time_msg_match(61649);
x=x{1};
7 Kommentare
Image Analyst
am 24 Okt. 2021
@vicente Noguer, did you overlook my request?
Also, a specific numerical example using the first 2 or 3 rows of your cell array would be helpful. Help us to help you.
Rik
am 24 Okt. 2021
You are ignoring the advice that Image Analyst is giving you. That is not smart.
Also, did you try making a it a double array instead of a cell? You will notice that my code will still do something usefull. It brings you only a single step away from the array you need.
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!