how do i update a value of a particular column of a cell without changing other columns and store the updated value along with other columns in other cell?

12 次查看(过去 30 天)
Hello everyone,
i read an excel file using xlsread in matlab.the excel file contains 2 columns and 5 rows. the structure of excel file is as follows:
Parameter Value
a 10
b 3
c 5
d 6
e 7
Now,Here i want to change the value of a particular column(lets say i want to change value of parameter a) the value should be present in a particular range say [5 to 15].Now,after changing its value i want to store the updated parameter along with other unchanged parameters in a separate cell and write that updated cell into excel using xlswrite. please note that original excel file which we read into matlab should not be changed or we can say that i have to create a completely different excel sheet and not update the original one.
Please Help,any help would be appreciated.
Thank You in advance

采纳的回答

Image Analyst
Image Analyst 2022-1-23
[~, ~, raw] = xlsread(inputFileName); % Read from input file.
raw{someRow, someColumn} = someDifferentValue; % Replace the cell with something different.
xlswrite(outputFileName, raw); % Write the cell out to a new file.
Of course you need to assign the filenames in advance, and also have the new value available.

更多回答(0 个)

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by