No slrealtime​.Instrumen​t.LineStyl​e in R2020b:

조회 수: 2 (최근 30일)
Musa
Musa 2025년 5월 14일
댓글: Musa 2025년 5월 14일
Hi,
I was looking at the documentation (R2020b) for "Instrument" and the following example was added to the explanantion of using it:
---------------------------------------------
ls2 = slrealtime.instrument.LineStyle();
ls2.Marker = '*';
ls2.MarkerSize = 4;
ls2.Color = 'black';
inst.connectLine(app.Axes1, "SineWave", 'ArrayIndex', 5, 'LineStyle', ls2, 'Callback', @(t,d)(d+app.Offset.Value));
---------------------------------------------
This seems to say that a LineStyle can be associated with an slrealtime.instrument object. I used the same for an slrealtime.instrument object in my App and got the following error message:
-----------------------------------------------
The class slrealtime.Instrument has no Constant property or Static method named
'LineStyle'.
Error in UECUStim_NNP_Realtime/setupInstrumentation (line 207)
app.linStyl = slrealtime.Instrument.LineStyle();
-----------------------------------------------
Am I missing something? Please help.

채택된 답변

Steven Lord
Steven Lord 2025년 5월 14일
slrealtime.instrument.LineStyle is not the same as slrealtime.Instrument.LineStyle. From the error message you're using a capital-I in that command rather than a lowercase-i. It's a similar type of problem as below (but the difference between s and S is easier to see.)
s1 = sin(pi) % works
s1 = 1.2246e-16
s2 = Sin(pi) % errors
Unrecognized function or variable 'Sin'.
  댓글 수: 2
Walter Roberson
Walter Roberson 2025년 5월 14일
Good catch!
Musa
Musa 2025년 5월 14일
That works! Thank you very much.
If I may, could I please ask a follow-up question? In my App, I defined all my instrument objects with an uppercase 'I' as in: app.hInst = slrealtime.Instrument(app.modelName); and everything works perfectly; except for that LineStyle aspect. Are there two different classes - one named 'instrument' and the other named 'Instrument'? I hope I am not doing something wrong using the uppercase 'I' version?
Thanks.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Debugging and Analysis에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by