.mat matrix use in folder

3 ビュー (過去 30 日間)
Frank Uhlig
Frank Uhlig 2022 年 6 月 27 日
コメント済み: Walter Roberson 2022 年 6 月 27 日
I have saved a fixed matrix with a name in my current working Matlab folder on Mac. Now it appears as 'G.... .mat' there when I click on "open" in that folder; together with all my function m-files in there. it takes the identical 368 bytes as in the Mac finder.
How can I work with that saved .mat file inside the local m-files in this folder ?
I tried the 'load G... .mat' command but that does not work; I have tried to run some of my codes with 'G... .mat' in place of my general A matrix input. Does not work work either.
I then tried to see the contents of this .mat file by cicking on it in the local Matlab finder window: This shows nothing.
I have read and tried out all what is advised here and on the general internet. Nothing works for me. Why, oh why did I try to save and multiply use that 'G... .mat' matrix, rather than typing it in by hand everytime I want to work on it again ? Why, oh why?
  1 件のコメント
Walter Roberson
Walter Roberson 2022 年 6 月 27 日
368 bytes for a .mat file is probably a .mat that has almost nothing in it.
For testing purposes, try using
whos -file "Fully qualified path to file goes here.mat"

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

回答 (1 件)

Frank Uhlig
Frank Uhlig 2022 年 6 月 27 日
Hdere is what happens with your command:
>> whos -file "Godunov.mat"
Error using whos
Could not find "Godunov.mat".
>> ls
FU_ATMmfiles.zip runVICMatrRmmev.m
Godunov.mat
and so forth, all in that same subfolder of m-files
  1 件のコメント
Walter Roberson
Walter Roberson 2022 年 6 月 27 日
Try
dinfo = dir('*.mat');
filenames = {dinfo.name};
nfiles = length(filenames);
for K = 1 : nfiles
thisfile = filenames{K};
fprintf('File name: |%s|\nCharacter codes: %s\n', thisfile, mat2str(double(thisfile)));
whos('-file', thisfile);
end
and see if anything shows up. If it does, then carefully compare the character codes for the name that looks like Godunov.mat to the expected character codes,
double('Godunov.mat')
ans = 1×11
71 111 100 117 110 111 118 46 109 97 116
Check for entries greater than 126, which can indicate unusual characters.

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

カテゴリ

Help Center および File ExchangeTiming and presenting 2D and 3D stimuli についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by