フィルターのクリア

about to run a file

3 ビュー (過去 30 日間)
Azizul
Azizul 2023 年 12 月 6 日
回答済み: Asim 2024 年 1 月 2 日
i run a mathlab code in the online mathlab. And the same file and code are in the same folder i uploaded. but when i run the code the same output comes that means the code can not read and impot the data file even they are in the same folder.
How can i solve this?
  1 件のコメント
Cris LaPierre
Cris LaPierre 2023 年 12 月 6 日
Very much depends on what is happening. Is there an error message displayed in MATLAB Online? If yes, please share the full error message (all the red text). Is your file path hardcoded in your script?

サインインしてコメントする。

回答 (1 件)

Asim
Asim 2024 年 1 月 2 日
Hello Azizul,
I understand you are facing problems with MATLAB not being able to read your data file even though it's in the same folder as your code. Here's a workaround for you:
  1. Verify Working Directory: Ensure MATLAB's current directory is the folder with your files using 'disp(pwd);'.
  2. Use Full Path: Directly specify the full path when loading your file, e.g., 'data = readtable('C:\full\path\to\your\file.csv');'.
  3. Check File Accessibility: Make sure the file isn't write-protected and that you have read permissions.
By following these steps, MATLAB should be able to locate and read your data file. If the issue persists, please provide additional details like code and error message for further assistance.
Best Regards,
Asim Asrar

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by