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에서 Numeric Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by