Issue with MATLAB .exe seeing data in excel as stagnant data when I need it to be able to read with each run of the .exe
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a program that uses XLSread and XLSwrite.
The program takes in some excel data from an excel file, we do some math, then we output to the excel file and open it up for the user to see the output.
This program works perfect in the IDE, but when I make an .EXE and try the program that way, whatever the last data I had in the excel run in the IDE, is ALWAYS the output for the .exe now. Even when I change the data in the excel file and rerun.
How would I go about making this dynamic? Or have the program read in the new data from the excel file with each subsequent run?
example:
******************************************************************************
% read in some data
[num,txt,raw] = xlsread('excelFile','REPORT');
% do some math
x= 5 * num (1)
%export it back to excel file
xlswrite('excelFile',matrix,'sheet1')
%open the file up for the user
winopen('excelFile')
******************************************************************************
any and all help is greatly aprecaited!
,Billy
댓글 수: 0
답변 (1개)
Walter Roberson
2023년 6월 28일
read about ctfroot which is the directory that the code will be executing in, and the location that your named files will have been copied to.
The executable will NOT be running in the user's home directory. You will need to figure out the user directory by looking at windows environment variables. Caution: some of the folders named in the environment variables do not have drive letter, which is a different environment variable
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!