Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Save .m file result in a different folder

조회 수: 1 (최근 30일)
Ahmed Siddig
Ahmed Siddig 2018년 6월 24일
댓글: Ahmed Siddig 2018년 6월 25일
Hi,I was wondering how can i save the result from a matlab function and use it in VB.net (if not possible then in a .txt file and then use it in VB.net). thanks in advance.
  댓글 수: 2
Sameer Gadekar
Sameer Gadekar 2018년 6월 25일
편집: Sameer Gadekar 2018년 6월 25일
x = 0:.1:1; A = [x; exp(x)]; fileID = fopen('exp.txt','w'); % Open the file in write mode fprintf(fileID,'%6s %12s\n','x','exp(x)'); % print the results in the file use appropriate format specifiers fprintf(fileID,'%6.2f %12.8f\n',A); % Write data to file fclose(fileID); % Close the file
Ahmed Siddig
Ahmed Siddig 2018년 6월 25일
Thanks Mr. Gadekar but when i executed your code i got this error: Error using fprintf Invalid file identifier. Use fopen to generate a valid file identifier.
Error in dele (line 3) fprintf(fileID,'%6s %12s\n','x','exp(x)'); % print the results in the file use appropriate format specifiers.
And one more thing in my code i already have a fopen() function in addition to the other one i will use will there be a problem executing 2 fopen() functions or will it run without error?

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by