フィルターのクリア

How to create class object in command line?

5 ビュー (過去 30 日間)
Mady J
Mady J 2018 年 9 月 25 日
回答済み: Joel Meyer Espinoza 2018 年 9 月 25 日
Hello,
I created a script which is contain one class. I want to use that class members in my function as argument. In matlab command window for compile the script i gave following commands:
1. obj = <class_name>
2. obj.workspace = <workspace' path>
3. function_name(obj)
but i want to write batch file in which i want to initialize class object and take workspace path from user and pass to function.Can anybody tell me what should i do? Thanks,

回答 (1 件)

Joel Meyer Espinoza
Joel Meyer Espinoza 2018 年 9 月 25 日
to get path of a folder use this:
pathObj=uigetdir();
if you want to share your variable or class between workspaces use global
%Skript 1
global yourClass
yourClass = BasicClass
yourClass.Value=2
%add to class what you want
%Skript 2
global yourClass
%now you can use yourClass in this skript

カテゴリ

Help Center および File ExchangeConstruct and Work with Object Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by