convert from cell array to double
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
pipor
am 3 Sep. 2023
Beantwortet: Abderrahim. B
am 3 Sep. 2023
b =
1×1 cell array
{1×2 cell}
i want to get last element in cell ("4") and convert it in double
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1472271/image.png)
0 Kommentare
Akzeptierte Antwort
Dyuman Joshi
am 3 Sep. 2023
Use indexing -
%Assuming this is how your data is stored
b = {{6,4}}
c = b{1}{2}
0 Kommentare
Weitere Antworten (1)
Abderrahim. B
am 3 Sep. 2023
Hi!
Use patentheses () if you want the output to be a cell
myCell = {42, rand(5)}
ele = myCell(1,2)
Use curly parentheses to get data from the cell in its type
ele = myCell{1,2}
You can also try cell2mat with the first approach to convert cell to array of double..
myCell = {42, rand(5)}
ele = cell2mat(myCell(1,2))
Hope this helps
Abderrahim
0 Kommentare
Siehe auch
Kategorien
Mehr zu Data Type Conversion 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!