Matlab Problem : Why after run the program, workspace or import data is disappeared ?

13 ビュー (過去 30 日間)
arash Moha
arash Moha 2021 年 5 月 30 日
回答済み: Jan 2021 年 5 月 30 日
Hello everyone , thanks a lot for any help to fix this problem.
i have one problom in my program , Why after run the program, workspace or import data is disappeared ? - what is the problem ?
and this is my code :
clc;
close all;
clear;
workspace;
cvp=cvpartition(size(letterrecognition,1),'HoldOut',0.25);
alphatrain = letterrecognition(cvp.training,:);
alphatest = letterrecognition(cvp.test,:);
Input_Train = alphatrain(:,2:end);
Target_Train = alphatrain(:,1);
Input_Test = alphatest(:,2:end);
Output_Test = alphatest(:,1);
Input_Train = Input_Train';
Target_Train = Target_Train';
Input_Test = Input_Test';
net = feedforwardnet(15);
net = train(net,Input_Train,Target_Train);
y = net(Input_Test);
M_Target_Test = y';
  2 件のコメント
Jan
Jan 2021 年 5 月 30 日
What does when disappear? Maybe you mean the effect of the clear command?
arash Moha
arash Moha 2021 年 5 月 30 日
Yes, I deleted the clear command code line , The problem was solved , Thank you very much .

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

採用された回答

Jan
Jan 2021 年 5 月 30 日
[After the comment has solved the problem, moved to the section for answers]
Remove the clear command, which is responsible for clearing the workspace.
Clearing variables is hardly useful in Matlab. Prefer to use functions instead of scripts to keep the workspace clean.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by