How can I check if a table contains numbers only?
Show older comments
Good evening,
I am trying to develop a MATLAB application that adds values to a table by reading them from an excel file, but these values need to be all numbers and the x-values in the table cannot be repeated twice. Can someone please help me?
Thank you
Edit: I forgot to mention that the program works, reads the data from the sheet, writes them on the table with the readtable functiion but I cannot implement validtation.
2 Comments
Mario Malic
on 9 May 2020
I would suggest trying to import data into a cell (or other type that will make it easier to write it to the table) variable and remove the values you don't need from there. Then write it to table.
Walter Roberson
on 9 May 2020
Can the x values be repeated once? 1 2 3 3 4 5 5 6 6 7 8 for example?
Accepted Answer
More Answers (1)
Image Analyst
on 9 May 2020
1 vote
Did you try the readmatrix() function? I believe it will import only numbers. Otherwise use xlsread() to get only the numbers.
Categories
Find more on Tables in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!