필터 지우기
필터 지우기

Unable to find file , load file to xl file .

조회 수: 2 (최근 30일)
Md. Mohidul Islam
Md. Mohidul Islam 2023년 1월 13일
편집: Stephen23 2023년 1월 14일
  댓글 수: 1
Stephen23
Stephen23 2023년 1월 14일
편집: Stephen23 2023년 1월 14일
Do NOT store user files in the installation directory of any application!
'C:\Program Files\MATLAB\R2022b\bin\my_excel_file.xls' % !!! DO NOT use this location !!!
Your Windows should protect the installation folder, so whatever you are doing ... is best avoided.

댓글을 달려면 로그인하십시오.

답변 (1개)

Voss
Voss 2023년 1월 13일
Two things:
1) You're using
y1 = xlsread('F:\matlab\bin_my_excel_file');
% ^ underscore
but 'bin' is a directory and the file is (supposedly) 'my_excel_file', so that should be
y = xlsread('F:\matlab\bin\my_excel_file');
% ^ backslash
2) Specify the file name completely, including the extension, either .csv or .xls. I don't know which one you mean because they both exist.
% which file?
% this one:
y1 = xlsread('F:\matlab\bin\my_excel_file.csv')
% or this one:
y1 = xlsread('F:\matlab\bin\my_excel_file.xls')
Also, readmatrix, readtable, and readcell are recommended over xlsread in R2022b.
You can pick the one that makes the most sense for the class of the variable that should represent the contents of the file (a matrix, a table, or a cell array, respectively).
  댓글 수: 4
Walter Roberson
Walter Roberson 2023년 1월 13일
이동: Voss 2023년 1월 13일
y1=xlsread('C:\Program Files\MATLAB\R2022b\bin\my_excel_file.xls');
We recommend against storing files in the MATLAB execution directory. You would need to be running with elevated access rights in order to be permtited to write files there.
Voss
Voss 2023년 1월 13일
@Md. Mohidul Islam: Do you have another question about the code you posted? If you want someone to be able to run it, they'd need to have the required files, including:
C:\Program Files\MATLAB\R2022b\bin\my_excel_file.xls
I:\BIOM_Signal_processing\Hw5\ECGsignal_1.mat
I:\BIOM_Signal_processing\Hw5\ECGsignal_1.xls

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Signal Analysis에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by