Can someone please explain how to make this simple program from the Primer run - I am a beginner with MatLab
1 次查看(过去 30 天)
显示 更早的评论
nsamples=5;
npoints=50;
for k=1:nsamples;
iterationString = ['Iteration # ', int2str(k)];
disp(iterationString)
currentData = rand(npoints,1);
sampleMean(k) = mean(currentData);
end
overallMean = mean(sampleMean);
0 个评论
回答(1 个)
Image Analyst
2015-12-17
On the Home tab or Editor tab of the tool ribbon, select New Script. Then paste it in to the new window it creates. Dock the window with the little down arrow on its title bar. You can grab its title bar and drag it to other docked locations if you want.
Then type F5 or else click the green Run triangle on the Editor tab of the tool ribbon.
I did it and it works fine with no errors or warnings at all.
2 个评论
Image Analyst
2015-12-17
Paste your code. It's not the code you originally pasted because that code runs perfectly.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!