How do I extract a number from a string?
显示 更早的评论
Good afternoon. I have the following problem. I have a matrix of type "Cell" in which there is data of type "string", said data is composed of a non-numeric character (a - U-) and a numeric character. I want to extract the numeric character of each of the cells in the matrix. Below I leave some images of how my matrices are made.

I want to extract the numerical values of all the "cells" of the last column.
the matrix is named "Yp_c"
Thank you.
2 个评论
per isakson
2019-6-22
I prefer downloading code/variables, which can be used in testing. Please upload Yp_c and possible more examples in a mat-file.
Pedro Guevara
2019-6-22
采纳的回答
更多回答(1 个)
Fikret Dogru
2019-6-22
0 个投票
Hello,
I didn't get your question well but if you want to extract numerical value try cell2mat first or use cell string to get values like Yp_c{:,:} all elements
类别
在 帮助中心 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!