Syntax error writing two classdef's

조회 수: 5 (최근 30일)
havva esra bilisik
havva esra bilisik 2016년 12월 19일
편집: per isakson 2016년 12월 29일
Hi,
I'm working with LTE-A simulator based on matlab.I tried to define two classdef's in one script and got an syntax error.
Can anyone help me how to write two classdef's in one script??
Esra

답변 (2개)

Adam
Adam 2016년 12월 19일
Why do you want two classdefs in one script?
For a start you can't define any classes in a script, and secondly each class must have its own file with the same name as the class, so you would need two distinct files, one for each class and then a third file containing a script, function or another class that uses these.

havva esra bilisik
havva esra bilisik 2016년 12월 19일
Hi,
In the simulator I'm using, I have two algorithms that I want to execute in the file. They are both defined with classdef and are in different files.
So i want to combine these two algorithms, because they are both defined by classdef i tried to copy the other algorithm into the first algorithm. I tried you write it correctly but got a syntax error.
Obviously I'm adding the second algorithm wrong.
As a result there two classdef defined algorithms at separate files and i want to combine these algorithms. How can I combine two classdefs in one file?
Esra
  댓글 수: 1
Adam
Adam 2016년 12월 19일
편집: per isakson 2016년 12월 29일
It depends entirely on the classes. There's no real reason to do this normally.
Please reply in comments though, don't add an answer that is really just a comment.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Parallel Computing Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by