Export data from matlab to excel file
6 次查看(过去 30 天)
显示 更早的评论
I'm creating a function that takes arguments in matlab. I already have a excel file with names and numbers but i want to change the number for and want matlab to write over the old number how do I write the function so that it overwrites the right field in the excel file? I don't want to name the field in the function since the function should work for any of the names....
1 个评论
回答(2 个)
Image Analyst
2014-5-22
You have to call xlsread() first. Then use ismember() to find out where the name occurs in the existing file. Then use the third argument in xlswrite() to write the data to the particular cell where it needs to go.
3 个评论
Image Analyst
2014-5-23
Correct. And also you need to use the output of ismember to find out what row 'Eric' resides at. You're also not using xlsread() or xlswrite() correctly. Please look at the help for those functions, plus ismember(), to find out how to do it. I can tell that you have not done that yet or you would not have code that looks anything like that. Also, newbalance is not defined. You didn't pass it in, or define it in the ChangeNumber() function.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!