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?

26 views (last 30 days)
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

Accepted Answer

Image Analyst
Image Analyst on 23 Jan 2022
[~, ~, 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.

More Answers (0)

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!