Repeating replacements in a row

3 次查看(过去 30 天)
Matt Brianik
Matt Brianik 2018-1-16
评论: Stephen23 2018-1-16
I’m having one final problem where I need to read in different rows of a table and replace specific values in each row with corresponding values in another table. so values 999 in Row A in table 1 need to be replaced by the first value in table 2 (Table 2 is just 1 Column of numbers),then 999 values in Row B in table 1 need to be replaced by value 2 in table 2.
I’m having a lot of difficulty with this, do you have any suggestions?
  9 个评论
Stephen23
Stephen23 2018-1-16
编辑:Stephen23 2018-1-16
In general just use indexing:
M(isnan(M)) = somelimitvalue
You might need to apply this to just one column, or otherwise tailor it to however your data is arranged.
Stephen23
Stephen23 2018-1-16
Matt Brianik's "Answer" moved here:
here is a sample file, i have my code reading in
here is what i have been doing so far code wise
clear
close all
CHOSEN_FILE='Sample_File.csv';
Table_Data = xlsread(CHOSEN_FILE);
% Table_Data(isnan(Table_Data))=999999;
Table_Labels = readtable(CHOSEN_FILE);
[Initial_CellCount_Rows,HH]= size(Table_Data);
Well_Data = Table_Data(4:Initial_CellCount_Rows,1:3:end)
Well_Labels= Table_Labels(2,5:3:end);
Well_Labels= table2cell(Well_Labels);
[CellCount_Row,CellCount_Collum] = size(Well_Data);
Number_of_Wells=CellCount_Collum;
Number_of_Compounds=(CellCount_Row);

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by