How to extract multiple numbers from an Excel cell?
    4 次查看(过去 30 天)
  
       显示 更早的评论
    
I am attempting to create a matrix for both the values and then two for the limits (one for the upper limit, and one for the lower limit). I have pasted the code I created below, but I am having issues now that I am reading the values in using an Excel file, instead of defining the matrices myself in MatLab.
%A = [1 2; 3 4; 5 6]; %my array (the actual values)
A= Value_Col;
% B = [[0,2] [3, 5]; [2, 4] [1, 2]; [4, 6] [3, 9]]; %the limits
 B= Limits_Col;
 % Upper Limit
 upper = B(:,2:2:end);
 %Lower Limit
 lower = B(:,1:2:end);
 x = A <= upper; %x should be below (or equal to) the upper limit
 y = A >= lower; %y should be above (or equal to) the lower limit
 %compares the limits and creates a new matrix
 % new matrix only includes the numbers are true for BOTH limit checks
 % (upper and lower)
 AFT_limits = x == y;
 %multiples arrays of the same size by cells
 %This would be the ouput on the final excel sheet  
 num = A .* AFT_limits;
3 个评论
  dpb
      
      
 2018-2-7
				If you don't enter the values into separate cells in Excel the only way you'll be able to retrieve them is as text which comes back as a cell string for the given cell.
Then you'll have to parse that string to retrieve the components thereof.
Would be much simpler to not do that... :)
回答(0 个)
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


