Good morning to everyone,
I've got a problem when I try to use the "pattern" function provided by the satellite communications toolbox (https://es.mathworks.com/help/satcom/ref/satcom.satellitescenario.transmitter.pattern.html#d124e26691l).
When I run my script, the command window shows the following error:
Error using pattern
Conversion to pattern from satcom.satellitescenario.Transmitter is not possible.
The script is using the "pattern" built-in function (https://es.mathworks.com/help/matlab/ref/pattern.html) instead of using the toolbox function. I've tried to change the path variable to put the toolbox folder at the search top, but it didn't work .
A little help would be appreciated.
Regards.

댓글 수: 4

Steven Lord
Steven Lord 2023년 1월 2일
Can you show us the relevant lines of your script (where you're trying to call the pattern method and where you define the inputs that you use in the pattern call)? It's possible you're calling it with a different signature than the pattern method supports.
Yeah, sure. I'm trying to run the example in documentation: https://es.mathworks.com/help/satcom/ref/satcom.satellitescenario.pattern.html
startTime = datetime(2021,2,12,13,30,0);
stopTime = startTime + hours(5);
sampleTime = 60; %seconds
sc = satelliteScenario(startTime,stopTime,sampleTime);
sat = satellite(sc,1e7,0,0,0,0,0);
gs = groundStation(sc,"Latitude",30,"Longitude",74);
tx = transmitter(sat,"Frequency",3e9);
rx = receiver(gs);
viewer = satelliteScenarioViewer(sc);
pat = pattern(tx);
pointAt(sat,gs);
pat.Size = 3000000;
pat.Colormap = "parula";
"pattern" (Patterns to search and match text) is not a function. It is a documentation page containing various object functions related to strings and patterns. "pattern" could also be an array defined in R2020b.
Nevertheless, I did not receive any error after executing the code shared above. Please execute the following commands in the command window to pin point the issue. Please change the working directory where the above code is saved. Share the output so that I can help you in resolving the issue.
>> dir(pwd) % shows the files and folders of the current working directory
>> which pattern -all % shows all files with the name "pattern"
>> which pattern -all
pattern is a built-in method % pattern constructor
D:\MATLABT2021a\toolbox\satcom\satcom\+satcom\+satellitescenario\GaussianAntenna.p % satcom.satellitescenario.GaussianAntenna method
D:\MATLABT2021a\toolbox\matlab\strfun\pattern\@pattern\pattern.m % Shadowed pattern constructor

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

 채택된 답변

Steven Lord
Steven Lord 2023년 1월 5일

0 개 추천

According to the Version History section on its documentation page the pattern function in Satellite Communications Toolbox was "Introduced in R2021b". You will need to upgrade to release R2021b or later to use it.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Reference Applications에 대해 자세히 알아보기

제품

릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by