Wie kann man in der Antenna Toolbox die Funktion show() auf ein Koordinatensystem ax beziehen?

35 views (last 30 days)
Mit show(antenna) kann sich eine gewählte Antenne grafisch in 3D darstellen lassen. Leider erscheint das Bild nur in einem zusätzlichen Fenster. Dadurch ist es offenbar unmöglich, eine entsprechende App, die show() nutzt, auf dem App-Server zu compilieren.
Gibt es dafür ein Workaround, so dass man die Darstellung der Antenne in einem eigenen UIAxes-Objekt darstellen lassen kann? Ist eine entsprechende Erweiterung wie etwa show(ax,antenna) geplant?

Answers (1)

Manikanta Aditya
Manikanta Aditya on 13 Nov 2024 at 6:20
Hi,
I will be answering this question in English.
To display an antenna in a specific UIAxes object use the show() function from the Antenna Toolbox. You can use the axes function to set the current axes to your desired UIAxes before calling show().
To know more about, refer to the following documentation:
I hope this helps.
  5 Comments
Robi
Robi on 16 Nov 2024 at 6:01
Thanks, but this doesn't run. I think there are two reasens:
  1. The mesh depends on frequency, the higher frequency the smaller meshlength. Therefore the mesh must be computed with frequency.
  2. Matrices for Vertices and Faces must be transposed when using patch. Your solution produces an error.
The following solution ist tested with a lot of antennas.
antenna=app.aktAntObj;
% Compute mesh for desired frequency stored in app.fmax.Value
f=impedance(antenna,1e6*app.fmax.Value);
antennaMesh = mesh(antenna);
cla(app.UIAxes3);
P=antennaMesh.Points; % needs to be transposed later
Faces=antennaMesh.Triangles(1:3,:) % needs to be transposed later
patch(app.UIAxes3,'Faces',Faces','Vertices',P','FaceColor','cyan');
%axis(app.UIAxes3, 'equal'); % Optional: for uniform scaling
grid(app.UIAxes3,'on');
view(app.UIAxes3, 3); % Set view to 3D
hold(app.UIAxes3, 'on'); % If you want to add more elements
There is still another possibility I tested with success. I wrote the antenna data as an STL-File in %temp% und read ist back to the client.This was necessary because of my desired server solution.
Robi
Robi on 16 Nov 2024 at 17:09
A little change for higher speed. As the mesh is only computes for the picture you can reduce the frequency to 1 Mhz which is an practical value and sufficiant for good picture.
f=impedance(antenna,1e6);

Sign in to comment.

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!