Want to create a matrix from a an existing excel spreadsheet in a specific column
1 view (last 30 days)
Show older comments
So I currently have this as the start of my code
inputdata=xlsread('01.csv') with input data being a 5004x19 matrix
In the 5th collum I would like to locate all of the cells that contain a 0 in them and create them into a seperate matrix called 'Zeros'
Thankyou
0 Comments
Answers (1)
Mark Sherstan
on 11 Dec 2018
I would be careful naming the variables zeros as that is used in MATLAB as a predfined function. This will do the trick for you though:
inputData = randi([0 10],5004,19);
idx = find(inputData(:,5) == 0);
zeroMatrix = inputData(idx,5);
0 Comments
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!