Borrar filtros
Borrar filtros

I want to put a column of information back into an excel sheet

1 visualización (últimos 30 días)
I'm using an excel sheet to calculate grades
lear all
data = xlsread('CengGrades.xlsx');
Homework = data(:,2);
Incourse = data(:,3);
Project = data(:,4);
Homework_Grade = Homework .* 0.2;
Incourse_Grade = Incourse .* 0.4;
Project_Grade = Project .* 0.4;
HG = Homework_Grade;
IG = Incourse_Grade;
PG = Project_Grade;
Final_Grade = HG + IG + PG;
FG = Final_Grade;
Ik some of the code is redundant, but i like it this way.
I want to input FG or Final_Grade back into the excel sheet

Respuesta aceptada

RAGHUNATHRAJU DASHARATHA
RAGHUNATHRAJU DASHARATHA el 14 de Nov. de 2022
A per my understanding you want to add a new column of information back to the excel sheet.
you can add the following lines of code to do that
data=[data FG]; %to append the new column to the exisitng data
xlswrite('CengGrades.xlsx' ,data,'Sheet1','A1'); % to write the new data to excelsheet
for further more go through the link
  2 comentarios
Tristan
Tristan el 14 de Nov. de 2022
The xlswrite command didn't work, I keep getting this error
Error using xlswrite (line 224)
Invoke Error, Dispatch Exception:
Source: Microsoft Excel
Description: SaveAs method of Workbook class failed
Help File: xlmain11.chm
Help Context ID: 0
RAGHUNATHRAJU DASHARATHA
RAGHUNATHRAJU DASHARATHA el 14 de Nov. de 2022
you can also do the following
FG= table(FG);
writetable(FG,'CengGrades.xlsx','Sheet',1,'Range','D1'); % D1 is the column of excelsheet.
%you can use column
% of your choice
for more infromation go through this link

Iniciar sesión para comentar.

Más respuestas (1)

Tristan
Tristan el 15 de Nov. de 2022
Perfect it worked, thanks

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by