matlab导入数据,运行代码出错。
16 ビュー (過去 30 日間)
古いコメントを表示
我把excel的数据转换成mat文件格式,然后出现以下问题
函数或变量 'shuju' 无法识别。
出错 MLplots (第 14 行)
G = graph(shuju(:,1), shuju(:,2));
以下是我的代码
load('shuju'); %Load data
g = graph(shuju(:,1), shuju(:,2));
lb = 0.0; %Upper and lower bounds for alpha
ub = 1.0;
[D, DD] = arrayfun(@(a) ... %Apply MLmodel to alpha values.
MLmodel(g,a, 1:10), linspace(lb,ub,11));
figure; %Plot Damage versus alpha.
plot(linspace(lb,ub,11), D, linspace(lb,ub,11), DD)
legend('D', 'D^{\prime}')
title('I. Damage versus \alpha Values (First 50 Node Failure)')
xlabel('\alpha Value')
ylabel('Damage')
0 件のコメント
採用された回答
locefaa
2023 年 3 月 30 日
我的意思是你文件能不能用load读取成功,看来是没有的,又或者是变量名并不是shuju,在load代码前面加上clear,将断点放在g = graph(shuju(:,1), shuju(:,2));查看工作区内容的方式来查看文件内容。
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で MATLAB Report Generator についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!