Tag Archives: matlab
How to resolve position violation errors in Simulink
Hello, I am working on an 8-axis Stewart platform simulator in Simulink. I have set motion inputs for the 8 prismatic joints using formula-based values and feedback control. Since the initial position of all prismatic joints is 0.5m, I set the priority to high in the Specify Position Target option and entered a value of 0.5m. However, when I run the simulation, a Position Violation error occurs as shown in the picture below. It seems that there is an issue with the motion input for the 8 prismatic joints. If you know how to solve this problem, I would appreciate your help.
I apologize for not being able to attach the entire model as it is part of an ongoing research project.
Thank you for your understanding.Hello, I am working on an 8-axis Stewart platform simulator in Simulink. I have set motion inputs for the 8 prismatic joints using formula-based values and feedback control. Since the initial position of all prismatic joints is 0.5m, I set the priority to high in the Specify Position Target option and entered a value of 0.5m. However, when I run the simulation, a Position Violation error occurs as shown in the picture below. It seems that there is an issue with the motion input for the 8 prismatic joints. If you know how to solve this problem, I would appreciate your help.
I apologize for not being able to attach the entire model as it is part of an ongoing research project.
Thank you for your understanding. Hello, I am working on an 8-axis Stewart platform simulator in Simulink. I have set motion inputs for the 8 prismatic joints using formula-based values and feedback control. Since the initial position of all prismatic joints is 0.5m, I set the priority to high in the Specify Position Target option and entered a value of 0.5m. However, when I run the simulation, a Position Violation error occurs as shown in the picture below. It seems that there is an issue with the motion input for the 8 prismatic joints. If you know how to solve this problem, I would appreciate your help.
I apologize for not being able to attach the entire model as it is part of an ongoing research project.
Thank you for your understanding. simulink, simscape MATLAB Answers — New Questions
​
after input values and push preview doesn’t display in UIAxes
classdef app1 < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
Toolbar matlab.ui.container.Toolbar
PushTool matlab.ui.container.toolbar.PushTool
EditField3_5 matlab.ui.control.NumericEditField
EditField2_5 matlab.ui.control.NumericEditField
EditField2_4 matlab.ui.control.NumericEditField
EditField3_4 matlab.ui.control.NumericEditField
EditField2_3 matlab.ui.control.NumericEditField
EditField2_2 matlab.ui.control.NumericEditField
EditField3_3 matlab.ui.control.NumericEditField
EditField3_2 matlab.ui.control.NumericEditField
EditField3 matlab.ui.control.NumericEditField
EditField2 matlab.ui.control.NumericEditField
DimensionPrpertyLabel matlab.ui.control.Label
PhaseLabel matlab.ui.control.Label
ElementDataLabel matlab.ui.control.Label
DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel matlab.ui.control.Label
CSTButton matlab.ui.control.Button
PreviewButton matlab.ui.control.Button
PhaseReference matlab.ui.control.NumericEditField
PhaseReferenceEditFieldLabel matlab.ui.control.Label
UnitElementDimensionsLabel matlab.ui.control.Label
Y matlab.ui.control.NumericEditField
YEditFieldLabel matlab.ui.control.Label
X matlab.ui.control.NumericEditField
XEditFieldLabel matlab.ui.control.Label
BeamDirectionLabel matlab.ui.control.Label
Azimuth matlab.ui.control.NumericEditField
AzimuthEditFieldLabel matlab.ui.control.Label
Elevation matlab.ui.control.NumericEditField
ElevationEditFieldLabel matlab.ui.control.Label
PhaseCenterCoordinates matlab.ui.control.Label
z matlab.ui.control.NumericEditField
zEditFieldLabel matlab.ui.control.Label
y matlab.ui.control.NumericEditField
yEditFieldLabel matlab.ui.control.Label
x matlab.ui.control.NumericEditField
xEditFieldLabel matlab.ui.control.Label
Image matlab.ui.control.Image
Frequency matlab.ui.control.NumericEditField
FrequencyEditFieldLabel matlab.ui.control.Label
Antennaradius matlab.ui.control.NumericEditField
AntennaradiusEditFieldLabel matlab.ui.control.Label
DesignareflectarrayLabel matlab.ui.control.Label
UIAxes matlab.ui.control.UIAxes
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: CSTButton
function CSTButtonPushed(app, event)
% — Executes on button press in pushbutton2.
% Create GUIDE-style callback args – Added by Migration Tool
[hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok<ASGLU>
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles = guidata(hObject);
addpath(genpath(‘C:UsersseymurDesktopcst-matlabCST-MATLAB-API-master’));
cst = actxserver(‘CSTStudio.application’);
mws = cst.invoke(‘NewMWS’);
cst = actxserver(‘CSTStudio.Application’);
mws = cst.OpenFile(‘path_to_your_cst_file.cst’);
fmin=2.2;
fmax=2.6;
function CstDefineFrequencyRange(mws, startFreq, endFreq)
mws.invoke(‘FrequencyRange’, ‘Define’, startFreq, endFreq);
end
mws = cst.invoke(‘NewMWS’);
Xmin=’expanded open’;
Xmax=’expanded open’;
Ymin=’expanded open’;
Ymax=’expanded open’;
Zmin=’expanded open’;
Zmax=’expanded open’;
minfrequency = fmin;
function CstDefineOpenBoundary(mws, minfrequency, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax)
% CstDefineOpenBoundary – Defines the open boundary in CST.
%
% Inputs:
% mws – CST Microwave Studio object
% minfrequency – Minimum frequency for the boundary
% Xmin, Xmax, Ymin, Ymax, Zmin, Zmax – Boundary limits in each direction
% Assuming CST’s boundary settings are being configured using invoke calls
invoke(mws, ‘Boundary’, ‘Define’, ‘Xmin’, Xmin);
invoke(mws, ‘Boundary’, ‘Define’, ‘Xmax’, Xmax);
invoke(mws, ‘Boundary’, ‘Define’, ‘Ymin’, Ymin);
invoke(mws, ‘Boundary’, ‘Define’, ‘Ymax’, Ymax);
invoke(mws, ‘Boundary’, ‘Define’, ‘Zmin’, Zmin);
invoke(mws, ‘Boundary’, ‘Define’, ‘Zmax’, Zmax);
% Set minimum frequency (this part may vary depending on how CST handles this)
invoke(mws, ‘Solver’, ‘FrequencyRange’, minfrequency);
end
freq = app.Frequency.Value * 10^9;
lambda = physconst(‘LightSpeed’)*1000/freq;
k=2*pi/lambda;
ix=1;
iy=1;
data=handles.data;
phas_u=data(:,1)’;
dim_u=data(:,2)’;
the_dir = app.Elevation.Value;
phi_dir = app.Azimuth.Value;
pha_zer = app.PhaseReference.Value;
x_cor = app.x.Value;
y_cor = app.y.Value;
z_cor = app.z.Value;
rad = app.Antennaradius.Value;
uedimx = app.X.Value;
uedimy = app.Y.Value;
for xi=-rad/2+mod(rad/2,uedimx):uedimx:rad/2
for yi=-rad/2+mod(rad/2,uedimy):uedimy:rad/2
if sqrt(xi^2+yi^2)<rad/2
R = sqrt((x_cor-xi)^2+(y_cor-yi)^2+z_cor^2);
phase(ix,iy)=k*(R-sind(the_dir)*(xi*cosd(phi_dir)+yi*sind(phi_dir)))+pha_zer;
m_phase=mod(phase(ix,iy),2*pi);
m_phase_deg=m_phase*180/pi-180;
% phas_lin_map=m_phase_deg*m+n;
if m_phase_deg > phas_u(1,1)
phas_lin_map = phas_u(1,1);
elseif m_phase_deg < phas_u(1,end)
phas_lin_map = phas_u(end,1);
else
dy = diff([0 phas_u]);
dyix = find(dy == 0);
dim_u(dyix) = dim_u(dyix-1)+1E-8;
phas_lin_map = interp1(phas_u, dim_u, m_phase_deg);
end
else
phase(ix,iy)=0;
end
iy=iy+1;
end
ix=ix+1;
iy=1;
end
m_phase=mod(phase,2*pi);
m_phase_deg=m_phase*180/pi;
m_phase_deg(:);
surf(app.UIAxes, m_phase_deg);
view(app.UIAxes, 2);
surf(m_phase_deg)
view(2)
guidata(hObject, handles);
end
% Value changed function: Antennaradius, Frequency
function AntennaradiusEditFieldValueChanged(app, event)
value = app.Antennaradius.Value;
end
% Button pushed function: PreviewButton
function PreviewButtonPushed(app, event)
% Button pushed function: PreviewButton
function PreviewButtonPushed(app, event)
% Create GUIDE-style callback args – Added by Migration Tool
[hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok<ASGLU>
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles = guidata(hObject);
% Frequency
freq = app.Frequency.Value * 10^9;
lambda = physconst(‘LightSpeed’) * 1000 / freq;
k = 2 * pi / lambda;
ix = 1;
iy = 1;
% Sample data (Replace with actual data assignment)
data = [140 0.2; 130 1.5; 0 2.5; -150 3.5; -175 4.5];
phas_u = data(:,1)’;
dim_u = data(:,2)’;
the_dir = app.Elevation.Value;
phi_dir = app.Azimuth.Value;
pha_zer = app.PhaseReference.Value;
x_cor = app.x.Value;
y_cor = app.y.Value;
z_cor = app.z.Value;
rad = app.Antennaradius.Value;
uedimx = app.X.Value;
uedimy = app.Y.Value;
% Initialize phase array
phase = zeros(round(rad/uedimx), round(rad/uedimy));
for xi = -rad/2+mod(rad/2,uedimx):uedimx:rad/2
for yi = -rad/2+mod(rad/2,uedimy):uedimy:rad/2
if sqrt(xi^2+yi^2) < rad/2
R = sqrt((x_cor-xi)^2 + (y_cor-yi)^2 + z_cor^2);
phase(ix, iy) = k * (R – sind(the_dir) * (xi * cosd(phi_dir) + yi * sind(phi_dir))) + pha_zer;
m_phase = mod(phase(ix, iy), 2*pi);
m_phase_deg = m_phase * 180 / pi – 180;
if m_phase_deg > phas_u(1,1)
phas_lin_map = phas_u(1,1);
elseif m_phase_deg < phas_u(1,end)
phas_lin_map = phas_u(end,1);
else
dy = diff([0 phas_u]);
dyix = find(dy == 0);
dim_u(dyix) = dim_u(dyix-1) + 1E-8;
phas_lin_map = interp1(phas_u, dim_u, m_phase_deg);
end
else
phase(ix, iy) = 0;
end
iy = iy + 1;
end
ix = ix + 1;
iy = 1;
end
% Convert to degrees
m_phase = mod(phase, 2*pi);
m_phase_deg = m_phase * 180 / pi;
% Debugging
disp(‘Phase (degrees):’);
disp(m_phase_deg);
% Plotting
surf(app.UIAxes, m_phase_deg);
view(app.UIAxes, 2);
guidata(hObject, handles);
end
end
% Close request function: UIFigure
function UIFigureCloseRequest(app, event)
delete(app)
end
% Value changed function: EditField2
function EditField2ValueChanged(app, event)
value = app.EditField2.Value;
end
end
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Get the file path for locating images
pathToMLAPP = fileparts(mfilename(‘fullpath’));
% Create UIFigure and hide until all components are created
app.UIFigure = uifigure(‘Visible’, ‘off’);
app.UIFigure.Color = [0.502 0.502 0.502];
app.UIFigure.Position = [100 100 984 624];
app.UIFigure.Name = ‘MATLAB App’;
app.UIFigure.CloseRequestFcn = createCallbackFcn(app, @UIFigureCloseRequest, true);
% Create Toolbar
app.Toolbar = uitoolbar(app.UIFigure);
% Create PushTool
app.PushTool = uipushtool(app.Toolbar);
app.PushTool.Icon = fullfile(pathToMLAPP, ‘images.png’);
% Create UIAxes
app.UIAxes = uiaxes(app.UIFigure);
app.UIAxes.XColor = [0 0 0];
app.UIAxes.Position = [602 321 329 262];
% Create DesignareflectarrayLabel
app.DesignareflectarrayLabel = uilabel(app.UIFigure);
app.DesignareflectarrayLabel.FontSize = 24;
app.DesignareflectarrayLabel.FontWeight = ‘bold’;
app.DesignareflectarrayLabel.Position = [363 593 261 32];
app.DesignareflectarrayLabel.Text = ‘Design a reflectarray ‘;
% Create AntennaradiusEditFieldLabel
app.AntennaradiusEditFieldLabel = uilabel(app.UIFigure);
app.AntennaradiusEditFieldLabel.HorizontalAlignment = ‘center’;
app.AntennaradiusEditFieldLabel.Position = [22 553 53 30];
app.AntennaradiusEditFieldLabel.Text = {‘Antenna ‘; ‘radius’};
% Create Antennaradius
app.Antennaradius = uieditfield(app.UIFigure, ‘numeric’);
app.Antennaradius.ValueChangedFcn = createCallbackFcn(app, @AntennaradiusEditFieldValueChanged, true);
app.Antennaradius.Position = [90 561 100 22];
% Create FrequencyEditFieldLabel
app.FrequencyEditFieldLabel = uilabel(app.UIFigure);
app.FrequencyEditFieldLabel.HorizontalAlignment = ‘right’;
app.FrequencyEditFieldLabel.Position = [10 522 65 22];
app.FrequencyEditFieldLabel.Text = ‘Frequency ‘;
% Create Frequency
app.Frequency = uieditfield(app.UIFigure, ‘numeric’);
app.Frequency.RoundFractionalValues = ‘on’;
app.Frequency.ValueChangedFcn = createCallbackFcn(app, @AntennaradiusEditFieldValueChanged, true);
app.Frequency.Position = [90 522 100 22];
% Create Image
app.Image = uiimage(app.UIFigure);
app.Image.Position = [231 345 370 219];
app.Image.ImageSource = fullfile(pathToMLAPP, ‘images.png’);
% Create xEditFieldLabel
app.xEditFieldLabel = uilabel(app.UIFigure);
app.xEditFieldLabel.HorizontalAlignment = ‘right’;
app.xEditFieldLabel.Position = [30 447 25 22];
app.xEditFieldLabel.Text = ‘x’;
% Create x
app.x = uieditfield(app.UIFigure, ‘numeric’);
app.x.Position = [70 447 100 22];
% Create yEditFieldLabel
app.yEditFieldLabel = uilabel(app.UIFigure);
app.yEditFieldLabel.HorizontalAlignment = ‘right’;
app.yEditFieldLabel.Position = [30 402 25 22];
app.yEditFieldLabel.Text = ‘y’;
% Create y
app.y = uieditfield(app.UIFigure, ‘numeric’);
app.y.Position = [70 402 100 22];
% Create zEditFieldLabel
app.zEditFieldLabel = uilabel(app.UIFigure);
app.zEditFieldLabel.HorizontalAlignment = ‘right’;
app.zEditFieldLabel.Position = [30 360 25 22];
app.zEditFieldLabel.Text = ‘z’;
% Create z
app.z = uieditfield(app.UIFigure, ‘numeric’);
app.z.Position = [70 360 100 22];
% Create PhaseCenterCoordinates
app.PhaseCenterCoordinates = uilabel(app.UIFigure);
app.PhaseCenterCoordinates.FontSize = 14;
app.PhaseCenterCoordinates.Position = [22 489 170 22];
app.PhaseCenterCoordinates.Text = ‘Phase Center Coordinates’;
% Create ElevationEditFieldLabel
app.ElevationEditFieldLabel = uilabel(app.UIFigure);
app.ElevationEditFieldLabel.HorizontalAlignment = ‘right’;
app.ElevationEditFieldLabel.Position = [15 285 54 22];
app.ElevationEditFieldLabel.Text = ‘Elevation’;
% Create Elevation
app.Elevation = uieditfield(app.UIFigure, ‘numeric’);
app.Elevation.Position = [84 285 64 22];
% Create AzimuthEditFieldLabel
app.AzimuthEditFieldLabel = uilabel(app.UIFigure);
app.AzimuthEditFieldLabel.HorizontalAlignment = ‘right’;
app.AzimuthEditFieldLabel.Position = [15 255 48 22];
app.AzimuthEditFieldLabel.Text = ‘Azimuth’;
% Create Azimuth
app.Azimuth = uieditfield(app.UIFigure, ‘numeric’);
app.Azimuth.Position = [84 255 64 22];
% Create BeamDirectionLabel
app.BeamDirectionLabel = uilabel(app.UIFigure);
app.BeamDirectionLabel.FontSize = 14;
app.BeamDirectionLabel.Position = [10 321 101 22];
app.BeamDirectionLabel.Text = ‘Beam Direction’;
% Create XEditFieldLabel
app.XEditFieldLabel = uilabel(app.UIFigure);
app.XEditFieldLabel.HorizontalAlignment = ‘right’;
app.XEditFieldLabel.Position = [31 174 25 22];
app.XEditFieldLabel.Text = ‘X’;
% Create X
app.X = uieditfield(app.UIFigure, ‘numeric’);
app.X.Position = [71 174 98 22];
% Create YEditFieldLabel
app.YEditFieldLabel = uilabel(app.UIFigure);
app.YEditFieldLabel.HorizontalAlignment = ‘right’;
app.YEditFieldLabel.Position = [29 126 25 22];
app.YEditFieldLabel.Text = ‘Y’;
% Create Y
app.Y = uieditfield(app.UIFigure, ‘numeric’);
app.Y.Position = [69 126 100 22];
% Create UnitElementDimensionsLabel
app.UnitElementDimensionsLabel = uilabel(app.UIFigure);
app.UnitElementDimensionsLabel.FontSize = 14;
app.UnitElementDimensionsLabel.Position = [15 216 162 22];
app.UnitElementDimensionsLabel.Text = ‘Unit Element Dimensions’;
% Create PhaseReferenceEditFieldLabel
app.PhaseReferenceEditFieldLabel = uilabel(app.UIFigure);
app.PhaseReferenceEditFieldLabel.HorizontalAlignment = ‘right’;
app.PhaseReferenceEditFieldLabel.Position = [9 83 98 22];
app.PhaseReferenceEditFieldLabel.Text = ‘Phase Reference’;
% Create PhaseReference
app.PhaseReference = uieditfield(app.UIFigure, ‘numeric’);
app.PhaseReference.Position = [130 83 58 22];
% Create PreviewButton
app.PreviewButton = uibutton(app.UIFigure, ‘push’);
app.PreviewButton.ButtonPushedFcn = createCallbackFcn(app, @PreviewButtonPushed, true);
app.PreviewButton.FontSize = 14;
app.PreviewButton.Position = [731 250 110 25];
app.PreviewButton.Text = ‘Preview’;
% Create CSTButton
app.CSTButton = uibutton(app.UIFigure, ‘push’);
app.CSTButton.ButtonPushedFcn = createCallbackFcn(app, @CSTButtonPushed, true);
app.CSTButton.FontSize = 14;
app.CSTButton.Position = [731 160 110 25];
app.CSTButton.Text = ‘ CST’;
% Create DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel = uilabel(app.UIFigure);
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel.BackgroundColor = [0.651 0.651 0.651];
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel.FontSize = 14;
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel.Position = [661 39 260 76];
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel.Text = {‘Desigener Eng .Abdullah Sabah Ibrahim’; ‘Air Navigation Engineer’; ‘uabd704@gmail.com’};
% Create ElementDataLabel
app.ElementDataLabel = uilabel(app.UIFigure);
app.ElementDataLabel.BackgroundColor = [0.502 0.502 0.502];
app.ElementDataLabel.FontSize = 14;
app.ElementDataLabel.Position = [320 310 142 27];
app.ElementDataLabel.Text = ‘Element Data’;
% Create PhaseLabel
app.PhaseLabel = uilabel(app.UIFigure);
app.PhaseLabel.Position = [326 281 39 22];
app.PhaseLabel.Text = ‘Phase’;
% Create DimensionPrpertyLabel
app.DimensionPrpertyLabel = uilabel(app.UIFigure);
app.DimensionPrpertyLabel.Position = [461 276 104 22];
app.DimensionPrpertyLabel.Text = ‘Dimension/Prperty’;
% Create EditField2
app.EditField2 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2.ValueChangedFcn = createCallbackFcn(app, @EditField2ValueChanged, true);
app.EditField2.Position = [461 242 100 22];
app.EditField2.Value = 0.2;
% Create EditField3
app.EditField3 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3.Position = [321 243 100 22];
app.EditField3.Value = 140;
% Create EditField3_2
app.EditField3_2 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3_2.Position = [320.997694832939 203.000512259345 100 22];
app.EditField3_2.Value = 130;
% Create EditField3_3
app.EditField3_3 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3_3.Position = [320.995929173063 161.393369402201 100 22];
% Create EditField2_2
app.EditField2_2 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2_2.Position = [461 203 100 22];
app.EditField2_2.Value = 1.5;
% Create EditField2_3
app.EditField2_3 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2_3.Position = [461 163 100 22];
app.EditField2_3.Value = 2.5;
% Create EditField3_4
app.EditField3_4 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3_4.Position = [321 123 100 22];
app.EditField3_4.Value = -150;
% Create EditField2_4
app.EditField2_4 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2_4.Position = [460.107943943571 122.820894513809 100 22];
app.EditField2_4.Value = 3.5;
% Create EditField2_5
app.EditField2_5 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2_5.Position = [461 83 100 22];
app.EditField2_5.Value = 4.5;
% Create EditField3_5
app.EditField3_5 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3_5.Position = [320.997989109585 81.5705348423533 100 22];
app.EditField3_5.Value = -175;
% Show the figure after all components are created
app.UIFigure.Visible = ‘on’;
end
end
% App creation and deletion
methods (Access = public)
% Construct app
function app = app1
% Create UIFigure and components
createComponents(app)
% Register the app with App Designer
registerApp(app, app.UIFigure)
if nargout == 0
clear app
end
end
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
delete(app.UIFigure)
end
end
endclassdef app1 < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
Toolbar matlab.ui.container.Toolbar
PushTool matlab.ui.container.toolbar.PushTool
EditField3_5 matlab.ui.control.NumericEditField
EditField2_5 matlab.ui.control.NumericEditField
EditField2_4 matlab.ui.control.NumericEditField
EditField3_4 matlab.ui.control.NumericEditField
EditField2_3 matlab.ui.control.NumericEditField
EditField2_2 matlab.ui.control.NumericEditField
EditField3_3 matlab.ui.control.NumericEditField
EditField3_2 matlab.ui.control.NumericEditField
EditField3 matlab.ui.control.NumericEditField
EditField2 matlab.ui.control.NumericEditField
DimensionPrpertyLabel matlab.ui.control.Label
PhaseLabel matlab.ui.control.Label
ElementDataLabel matlab.ui.control.Label
DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel matlab.ui.control.Label
CSTButton matlab.ui.control.Button
PreviewButton matlab.ui.control.Button
PhaseReference matlab.ui.control.NumericEditField
PhaseReferenceEditFieldLabel matlab.ui.control.Label
UnitElementDimensionsLabel matlab.ui.control.Label
Y matlab.ui.control.NumericEditField
YEditFieldLabel matlab.ui.control.Label
X matlab.ui.control.NumericEditField
XEditFieldLabel matlab.ui.control.Label
BeamDirectionLabel matlab.ui.control.Label
Azimuth matlab.ui.control.NumericEditField
AzimuthEditFieldLabel matlab.ui.control.Label
Elevation matlab.ui.control.NumericEditField
ElevationEditFieldLabel matlab.ui.control.Label
PhaseCenterCoordinates matlab.ui.control.Label
z matlab.ui.control.NumericEditField
zEditFieldLabel matlab.ui.control.Label
y matlab.ui.control.NumericEditField
yEditFieldLabel matlab.ui.control.Label
x matlab.ui.control.NumericEditField
xEditFieldLabel matlab.ui.control.Label
Image matlab.ui.control.Image
Frequency matlab.ui.control.NumericEditField
FrequencyEditFieldLabel matlab.ui.control.Label
Antennaradius matlab.ui.control.NumericEditField
AntennaradiusEditFieldLabel matlab.ui.control.Label
DesignareflectarrayLabel matlab.ui.control.Label
UIAxes matlab.ui.control.UIAxes
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: CSTButton
function CSTButtonPushed(app, event)
% — Executes on button press in pushbutton2.
% Create GUIDE-style callback args – Added by Migration Tool
[hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok<ASGLU>
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles = guidata(hObject);
addpath(genpath(‘C:UsersseymurDesktopcst-matlabCST-MATLAB-API-master’));
cst = actxserver(‘CSTStudio.application’);
mws = cst.invoke(‘NewMWS’);
cst = actxserver(‘CSTStudio.Application’);
mws = cst.OpenFile(‘path_to_your_cst_file.cst’);
fmin=2.2;
fmax=2.6;
function CstDefineFrequencyRange(mws, startFreq, endFreq)
mws.invoke(‘FrequencyRange’, ‘Define’, startFreq, endFreq);
end
mws = cst.invoke(‘NewMWS’);
Xmin=’expanded open’;
Xmax=’expanded open’;
Ymin=’expanded open’;
Ymax=’expanded open’;
Zmin=’expanded open’;
Zmax=’expanded open’;
minfrequency = fmin;
function CstDefineOpenBoundary(mws, minfrequency, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax)
% CstDefineOpenBoundary – Defines the open boundary in CST.
%
% Inputs:
% mws – CST Microwave Studio object
% minfrequency – Minimum frequency for the boundary
% Xmin, Xmax, Ymin, Ymax, Zmin, Zmax – Boundary limits in each direction
% Assuming CST’s boundary settings are being configured using invoke calls
invoke(mws, ‘Boundary’, ‘Define’, ‘Xmin’, Xmin);
invoke(mws, ‘Boundary’, ‘Define’, ‘Xmax’, Xmax);
invoke(mws, ‘Boundary’, ‘Define’, ‘Ymin’, Ymin);
invoke(mws, ‘Boundary’, ‘Define’, ‘Ymax’, Ymax);
invoke(mws, ‘Boundary’, ‘Define’, ‘Zmin’, Zmin);
invoke(mws, ‘Boundary’, ‘Define’, ‘Zmax’, Zmax);
% Set minimum frequency (this part may vary depending on how CST handles this)
invoke(mws, ‘Solver’, ‘FrequencyRange’, minfrequency);
end
freq = app.Frequency.Value * 10^9;
lambda = physconst(‘LightSpeed’)*1000/freq;
k=2*pi/lambda;
ix=1;
iy=1;
data=handles.data;
phas_u=data(:,1)’;
dim_u=data(:,2)’;
the_dir = app.Elevation.Value;
phi_dir = app.Azimuth.Value;
pha_zer = app.PhaseReference.Value;
x_cor = app.x.Value;
y_cor = app.y.Value;
z_cor = app.z.Value;
rad = app.Antennaradius.Value;
uedimx = app.X.Value;
uedimy = app.Y.Value;
for xi=-rad/2+mod(rad/2,uedimx):uedimx:rad/2
for yi=-rad/2+mod(rad/2,uedimy):uedimy:rad/2
if sqrt(xi^2+yi^2)<rad/2
R = sqrt((x_cor-xi)^2+(y_cor-yi)^2+z_cor^2);
phase(ix,iy)=k*(R-sind(the_dir)*(xi*cosd(phi_dir)+yi*sind(phi_dir)))+pha_zer;
m_phase=mod(phase(ix,iy),2*pi);
m_phase_deg=m_phase*180/pi-180;
% phas_lin_map=m_phase_deg*m+n;
if m_phase_deg > phas_u(1,1)
phas_lin_map = phas_u(1,1);
elseif m_phase_deg < phas_u(1,end)
phas_lin_map = phas_u(end,1);
else
dy = diff([0 phas_u]);
dyix = find(dy == 0);
dim_u(dyix) = dim_u(dyix-1)+1E-8;
phas_lin_map = interp1(phas_u, dim_u, m_phase_deg);
end
else
phase(ix,iy)=0;
end
iy=iy+1;
end
ix=ix+1;
iy=1;
end
m_phase=mod(phase,2*pi);
m_phase_deg=m_phase*180/pi;
m_phase_deg(:);
surf(app.UIAxes, m_phase_deg);
view(app.UIAxes, 2);
surf(m_phase_deg)
view(2)
guidata(hObject, handles);
end
% Value changed function: Antennaradius, Frequency
function AntennaradiusEditFieldValueChanged(app, event)
value = app.Antennaradius.Value;
end
% Button pushed function: PreviewButton
function PreviewButtonPushed(app, event)
% Button pushed function: PreviewButton
function PreviewButtonPushed(app, event)
% Create GUIDE-style callback args – Added by Migration Tool
[hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok<ASGLU>
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles = guidata(hObject);
% Frequency
freq = app.Frequency.Value * 10^9;
lambda = physconst(‘LightSpeed’) * 1000 / freq;
k = 2 * pi / lambda;
ix = 1;
iy = 1;
% Sample data (Replace with actual data assignment)
data = [140 0.2; 130 1.5; 0 2.5; -150 3.5; -175 4.5];
phas_u = data(:,1)’;
dim_u = data(:,2)’;
the_dir = app.Elevation.Value;
phi_dir = app.Azimuth.Value;
pha_zer = app.PhaseReference.Value;
x_cor = app.x.Value;
y_cor = app.y.Value;
z_cor = app.z.Value;
rad = app.Antennaradius.Value;
uedimx = app.X.Value;
uedimy = app.Y.Value;
% Initialize phase array
phase = zeros(round(rad/uedimx), round(rad/uedimy));
for xi = -rad/2+mod(rad/2,uedimx):uedimx:rad/2
for yi = -rad/2+mod(rad/2,uedimy):uedimy:rad/2
if sqrt(xi^2+yi^2) < rad/2
R = sqrt((x_cor-xi)^2 + (y_cor-yi)^2 + z_cor^2);
phase(ix, iy) = k * (R – sind(the_dir) * (xi * cosd(phi_dir) + yi * sind(phi_dir))) + pha_zer;
m_phase = mod(phase(ix, iy), 2*pi);
m_phase_deg = m_phase * 180 / pi – 180;
if m_phase_deg > phas_u(1,1)
phas_lin_map = phas_u(1,1);
elseif m_phase_deg < phas_u(1,end)
phas_lin_map = phas_u(end,1);
else
dy = diff([0 phas_u]);
dyix = find(dy == 0);
dim_u(dyix) = dim_u(dyix-1) + 1E-8;
phas_lin_map = interp1(phas_u, dim_u, m_phase_deg);
end
else
phase(ix, iy) = 0;
end
iy = iy + 1;
end
ix = ix + 1;
iy = 1;
end
% Convert to degrees
m_phase = mod(phase, 2*pi);
m_phase_deg = m_phase * 180 / pi;
% Debugging
disp(‘Phase (degrees):’);
disp(m_phase_deg);
% Plotting
surf(app.UIAxes, m_phase_deg);
view(app.UIAxes, 2);
guidata(hObject, handles);
end
end
% Close request function: UIFigure
function UIFigureCloseRequest(app, event)
delete(app)
end
% Value changed function: EditField2
function EditField2ValueChanged(app, event)
value = app.EditField2.Value;
end
end
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Get the file path for locating images
pathToMLAPP = fileparts(mfilename(‘fullpath’));
% Create UIFigure and hide until all components are created
app.UIFigure = uifigure(‘Visible’, ‘off’);
app.UIFigure.Color = [0.502 0.502 0.502];
app.UIFigure.Position = [100 100 984 624];
app.UIFigure.Name = ‘MATLAB App’;
app.UIFigure.CloseRequestFcn = createCallbackFcn(app, @UIFigureCloseRequest, true);
% Create Toolbar
app.Toolbar = uitoolbar(app.UIFigure);
% Create PushTool
app.PushTool = uipushtool(app.Toolbar);
app.PushTool.Icon = fullfile(pathToMLAPP, ‘images.png’);
% Create UIAxes
app.UIAxes = uiaxes(app.UIFigure);
app.UIAxes.XColor = [0 0 0];
app.UIAxes.Position = [602 321 329 262];
% Create DesignareflectarrayLabel
app.DesignareflectarrayLabel = uilabel(app.UIFigure);
app.DesignareflectarrayLabel.FontSize = 24;
app.DesignareflectarrayLabel.FontWeight = ‘bold’;
app.DesignareflectarrayLabel.Position = [363 593 261 32];
app.DesignareflectarrayLabel.Text = ‘Design a reflectarray ‘;
% Create AntennaradiusEditFieldLabel
app.AntennaradiusEditFieldLabel = uilabel(app.UIFigure);
app.AntennaradiusEditFieldLabel.HorizontalAlignment = ‘center’;
app.AntennaradiusEditFieldLabel.Position = [22 553 53 30];
app.AntennaradiusEditFieldLabel.Text = {‘Antenna ‘; ‘radius’};
% Create Antennaradius
app.Antennaradius = uieditfield(app.UIFigure, ‘numeric’);
app.Antennaradius.ValueChangedFcn = createCallbackFcn(app, @AntennaradiusEditFieldValueChanged, true);
app.Antennaradius.Position = [90 561 100 22];
% Create FrequencyEditFieldLabel
app.FrequencyEditFieldLabel = uilabel(app.UIFigure);
app.FrequencyEditFieldLabel.HorizontalAlignment = ‘right’;
app.FrequencyEditFieldLabel.Position = [10 522 65 22];
app.FrequencyEditFieldLabel.Text = ‘Frequency ‘;
% Create Frequency
app.Frequency = uieditfield(app.UIFigure, ‘numeric’);
app.Frequency.RoundFractionalValues = ‘on’;
app.Frequency.ValueChangedFcn = createCallbackFcn(app, @AntennaradiusEditFieldValueChanged, true);
app.Frequency.Position = [90 522 100 22];
% Create Image
app.Image = uiimage(app.UIFigure);
app.Image.Position = [231 345 370 219];
app.Image.ImageSource = fullfile(pathToMLAPP, ‘images.png’);
% Create xEditFieldLabel
app.xEditFieldLabel = uilabel(app.UIFigure);
app.xEditFieldLabel.HorizontalAlignment = ‘right’;
app.xEditFieldLabel.Position = [30 447 25 22];
app.xEditFieldLabel.Text = ‘x’;
% Create x
app.x = uieditfield(app.UIFigure, ‘numeric’);
app.x.Position = [70 447 100 22];
% Create yEditFieldLabel
app.yEditFieldLabel = uilabel(app.UIFigure);
app.yEditFieldLabel.HorizontalAlignment = ‘right’;
app.yEditFieldLabel.Position = [30 402 25 22];
app.yEditFieldLabel.Text = ‘y’;
% Create y
app.y = uieditfield(app.UIFigure, ‘numeric’);
app.y.Position = [70 402 100 22];
% Create zEditFieldLabel
app.zEditFieldLabel = uilabel(app.UIFigure);
app.zEditFieldLabel.HorizontalAlignment = ‘right’;
app.zEditFieldLabel.Position = [30 360 25 22];
app.zEditFieldLabel.Text = ‘z’;
% Create z
app.z = uieditfield(app.UIFigure, ‘numeric’);
app.z.Position = [70 360 100 22];
% Create PhaseCenterCoordinates
app.PhaseCenterCoordinates = uilabel(app.UIFigure);
app.PhaseCenterCoordinates.FontSize = 14;
app.PhaseCenterCoordinates.Position = [22 489 170 22];
app.PhaseCenterCoordinates.Text = ‘Phase Center Coordinates’;
% Create ElevationEditFieldLabel
app.ElevationEditFieldLabel = uilabel(app.UIFigure);
app.ElevationEditFieldLabel.HorizontalAlignment = ‘right’;
app.ElevationEditFieldLabel.Position = [15 285 54 22];
app.ElevationEditFieldLabel.Text = ‘Elevation’;
% Create Elevation
app.Elevation = uieditfield(app.UIFigure, ‘numeric’);
app.Elevation.Position = [84 285 64 22];
% Create AzimuthEditFieldLabel
app.AzimuthEditFieldLabel = uilabel(app.UIFigure);
app.AzimuthEditFieldLabel.HorizontalAlignment = ‘right’;
app.AzimuthEditFieldLabel.Position = [15 255 48 22];
app.AzimuthEditFieldLabel.Text = ‘Azimuth’;
% Create Azimuth
app.Azimuth = uieditfield(app.UIFigure, ‘numeric’);
app.Azimuth.Position = [84 255 64 22];
% Create BeamDirectionLabel
app.BeamDirectionLabel = uilabel(app.UIFigure);
app.BeamDirectionLabel.FontSize = 14;
app.BeamDirectionLabel.Position = [10 321 101 22];
app.BeamDirectionLabel.Text = ‘Beam Direction’;
% Create XEditFieldLabel
app.XEditFieldLabel = uilabel(app.UIFigure);
app.XEditFieldLabel.HorizontalAlignment = ‘right’;
app.XEditFieldLabel.Position = [31 174 25 22];
app.XEditFieldLabel.Text = ‘X’;
% Create X
app.X = uieditfield(app.UIFigure, ‘numeric’);
app.X.Position = [71 174 98 22];
% Create YEditFieldLabel
app.YEditFieldLabel = uilabel(app.UIFigure);
app.YEditFieldLabel.HorizontalAlignment = ‘right’;
app.YEditFieldLabel.Position = [29 126 25 22];
app.YEditFieldLabel.Text = ‘Y’;
% Create Y
app.Y = uieditfield(app.UIFigure, ‘numeric’);
app.Y.Position = [69 126 100 22];
% Create UnitElementDimensionsLabel
app.UnitElementDimensionsLabel = uilabel(app.UIFigure);
app.UnitElementDimensionsLabel.FontSize = 14;
app.UnitElementDimensionsLabel.Position = [15 216 162 22];
app.UnitElementDimensionsLabel.Text = ‘Unit Element Dimensions’;
% Create PhaseReferenceEditFieldLabel
app.PhaseReferenceEditFieldLabel = uilabel(app.UIFigure);
app.PhaseReferenceEditFieldLabel.HorizontalAlignment = ‘right’;
app.PhaseReferenceEditFieldLabel.Position = [9 83 98 22];
app.PhaseReferenceEditFieldLabel.Text = ‘Phase Reference’;
% Create PhaseReference
app.PhaseReference = uieditfield(app.UIFigure, ‘numeric’);
app.PhaseReference.Position = [130 83 58 22];
% Create PreviewButton
app.PreviewButton = uibutton(app.UIFigure, ‘push’);
app.PreviewButton.ButtonPushedFcn = createCallbackFcn(app, @PreviewButtonPushed, true);
app.PreviewButton.FontSize = 14;
app.PreviewButton.Position = [731 250 110 25];
app.PreviewButton.Text = ‘Preview’;
% Create CSTButton
app.CSTButton = uibutton(app.UIFigure, ‘push’);
app.CSTButton.ButtonPushedFcn = createCallbackFcn(app, @CSTButtonPushed, true);
app.CSTButton.FontSize = 14;
app.CSTButton.Position = [731 160 110 25];
app.CSTButton.Text = ‘ CST’;
% Create DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel = uilabel(app.UIFigure);
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel.BackgroundColor = [0.651 0.651 0.651];
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel.FontSize = 14;
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel.Position = [661 39 260 76];
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel.Text = {‘Desigener Eng .Abdullah Sabah Ibrahim’; ‘Air Navigation Engineer’; ‘uabd704@gmail.com’};
% Create ElementDataLabel
app.ElementDataLabel = uilabel(app.UIFigure);
app.ElementDataLabel.BackgroundColor = [0.502 0.502 0.502];
app.ElementDataLabel.FontSize = 14;
app.ElementDataLabel.Position = [320 310 142 27];
app.ElementDataLabel.Text = ‘Element Data’;
% Create PhaseLabel
app.PhaseLabel = uilabel(app.UIFigure);
app.PhaseLabel.Position = [326 281 39 22];
app.PhaseLabel.Text = ‘Phase’;
% Create DimensionPrpertyLabel
app.DimensionPrpertyLabel = uilabel(app.UIFigure);
app.DimensionPrpertyLabel.Position = [461 276 104 22];
app.DimensionPrpertyLabel.Text = ‘Dimension/Prperty’;
% Create EditField2
app.EditField2 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2.ValueChangedFcn = createCallbackFcn(app, @EditField2ValueChanged, true);
app.EditField2.Position = [461 242 100 22];
app.EditField2.Value = 0.2;
% Create EditField3
app.EditField3 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3.Position = [321 243 100 22];
app.EditField3.Value = 140;
% Create EditField3_2
app.EditField3_2 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3_2.Position = [320.997694832939 203.000512259345 100 22];
app.EditField3_2.Value = 130;
% Create EditField3_3
app.EditField3_3 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3_3.Position = [320.995929173063 161.393369402201 100 22];
% Create EditField2_2
app.EditField2_2 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2_2.Position = [461 203 100 22];
app.EditField2_2.Value = 1.5;
% Create EditField2_3
app.EditField2_3 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2_3.Position = [461 163 100 22];
app.EditField2_3.Value = 2.5;
% Create EditField3_4
app.EditField3_4 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3_4.Position = [321 123 100 22];
app.EditField3_4.Value = -150;
% Create EditField2_4
app.EditField2_4 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2_4.Position = [460.107943943571 122.820894513809 100 22];
app.EditField2_4.Value = 3.5;
% Create EditField2_5
app.EditField2_5 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2_5.Position = [461 83 100 22];
app.EditField2_5.Value = 4.5;
% Create EditField3_5
app.EditField3_5 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3_5.Position = [320.997989109585 81.5705348423533 100 22];
app.EditField3_5.Value = -175;
% Show the figure after all components are created
app.UIFigure.Visible = ‘on’;
end
end
% App creation and deletion
methods (Access = public)
% Construct app
function app = app1
% Create UIFigure and components
createComponents(app)
% Register the app with App Designer
registerApp(app, app.UIFigure)
if nargout == 0
clear app
end
end
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
delete(app.UIFigure)
end
end
end classdef app1 < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
Toolbar matlab.ui.container.Toolbar
PushTool matlab.ui.container.toolbar.PushTool
EditField3_5 matlab.ui.control.NumericEditField
EditField2_5 matlab.ui.control.NumericEditField
EditField2_4 matlab.ui.control.NumericEditField
EditField3_4 matlab.ui.control.NumericEditField
EditField2_3 matlab.ui.control.NumericEditField
EditField2_2 matlab.ui.control.NumericEditField
EditField3_3 matlab.ui.control.NumericEditField
EditField3_2 matlab.ui.control.NumericEditField
EditField3 matlab.ui.control.NumericEditField
EditField2 matlab.ui.control.NumericEditField
DimensionPrpertyLabel matlab.ui.control.Label
PhaseLabel matlab.ui.control.Label
ElementDataLabel matlab.ui.control.Label
DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel matlab.ui.control.Label
CSTButton matlab.ui.control.Button
PreviewButton matlab.ui.control.Button
PhaseReference matlab.ui.control.NumericEditField
PhaseReferenceEditFieldLabel matlab.ui.control.Label
UnitElementDimensionsLabel matlab.ui.control.Label
Y matlab.ui.control.NumericEditField
YEditFieldLabel matlab.ui.control.Label
X matlab.ui.control.NumericEditField
XEditFieldLabel matlab.ui.control.Label
BeamDirectionLabel matlab.ui.control.Label
Azimuth matlab.ui.control.NumericEditField
AzimuthEditFieldLabel matlab.ui.control.Label
Elevation matlab.ui.control.NumericEditField
ElevationEditFieldLabel matlab.ui.control.Label
PhaseCenterCoordinates matlab.ui.control.Label
z matlab.ui.control.NumericEditField
zEditFieldLabel matlab.ui.control.Label
y matlab.ui.control.NumericEditField
yEditFieldLabel matlab.ui.control.Label
x matlab.ui.control.NumericEditField
xEditFieldLabel matlab.ui.control.Label
Image matlab.ui.control.Image
Frequency matlab.ui.control.NumericEditField
FrequencyEditFieldLabel matlab.ui.control.Label
Antennaradius matlab.ui.control.NumericEditField
AntennaradiusEditFieldLabel matlab.ui.control.Label
DesignareflectarrayLabel matlab.ui.control.Label
UIAxes matlab.ui.control.UIAxes
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: CSTButton
function CSTButtonPushed(app, event)
% — Executes on button press in pushbutton2.
% Create GUIDE-style callback args – Added by Migration Tool
[hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok<ASGLU>
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles = guidata(hObject);
addpath(genpath(‘C:UsersseymurDesktopcst-matlabCST-MATLAB-API-master’));
cst = actxserver(‘CSTStudio.application’);
mws = cst.invoke(‘NewMWS’);
cst = actxserver(‘CSTStudio.Application’);
mws = cst.OpenFile(‘path_to_your_cst_file.cst’);
fmin=2.2;
fmax=2.6;
function CstDefineFrequencyRange(mws, startFreq, endFreq)
mws.invoke(‘FrequencyRange’, ‘Define’, startFreq, endFreq);
end
mws = cst.invoke(‘NewMWS’);
Xmin=’expanded open’;
Xmax=’expanded open’;
Ymin=’expanded open’;
Ymax=’expanded open’;
Zmin=’expanded open’;
Zmax=’expanded open’;
minfrequency = fmin;
function CstDefineOpenBoundary(mws, minfrequency, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax)
% CstDefineOpenBoundary – Defines the open boundary in CST.
%
% Inputs:
% mws – CST Microwave Studio object
% minfrequency – Minimum frequency for the boundary
% Xmin, Xmax, Ymin, Ymax, Zmin, Zmax – Boundary limits in each direction
% Assuming CST’s boundary settings are being configured using invoke calls
invoke(mws, ‘Boundary’, ‘Define’, ‘Xmin’, Xmin);
invoke(mws, ‘Boundary’, ‘Define’, ‘Xmax’, Xmax);
invoke(mws, ‘Boundary’, ‘Define’, ‘Ymin’, Ymin);
invoke(mws, ‘Boundary’, ‘Define’, ‘Ymax’, Ymax);
invoke(mws, ‘Boundary’, ‘Define’, ‘Zmin’, Zmin);
invoke(mws, ‘Boundary’, ‘Define’, ‘Zmax’, Zmax);
% Set minimum frequency (this part may vary depending on how CST handles this)
invoke(mws, ‘Solver’, ‘FrequencyRange’, minfrequency);
end
freq = app.Frequency.Value * 10^9;
lambda = physconst(‘LightSpeed’)*1000/freq;
k=2*pi/lambda;
ix=1;
iy=1;
data=handles.data;
phas_u=data(:,1)’;
dim_u=data(:,2)’;
the_dir = app.Elevation.Value;
phi_dir = app.Azimuth.Value;
pha_zer = app.PhaseReference.Value;
x_cor = app.x.Value;
y_cor = app.y.Value;
z_cor = app.z.Value;
rad = app.Antennaradius.Value;
uedimx = app.X.Value;
uedimy = app.Y.Value;
for xi=-rad/2+mod(rad/2,uedimx):uedimx:rad/2
for yi=-rad/2+mod(rad/2,uedimy):uedimy:rad/2
if sqrt(xi^2+yi^2)<rad/2
R = sqrt((x_cor-xi)^2+(y_cor-yi)^2+z_cor^2);
phase(ix,iy)=k*(R-sind(the_dir)*(xi*cosd(phi_dir)+yi*sind(phi_dir)))+pha_zer;
m_phase=mod(phase(ix,iy),2*pi);
m_phase_deg=m_phase*180/pi-180;
% phas_lin_map=m_phase_deg*m+n;
if m_phase_deg > phas_u(1,1)
phas_lin_map = phas_u(1,1);
elseif m_phase_deg < phas_u(1,end)
phas_lin_map = phas_u(end,1);
else
dy = diff([0 phas_u]);
dyix = find(dy == 0);
dim_u(dyix) = dim_u(dyix-1)+1E-8;
phas_lin_map = interp1(phas_u, dim_u, m_phase_deg);
end
else
phase(ix,iy)=0;
end
iy=iy+1;
end
ix=ix+1;
iy=1;
end
m_phase=mod(phase,2*pi);
m_phase_deg=m_phase*180/pi;
m_phase_deg(:);
surf(app.UIAxes, m_phase_deg);
view(app.UIAxes, 2);
surf(m_phase_deg)
view(2)
guidata(hObject, handles);
end
% Value changed function: Antennaradius, Frequency
function AntennaradiusEditFieldValueChanged(app, event)
value = app.Antennaradius.Value;
end
% Button pushed function: PreviewButton
function PreviewButtonPushed(app, event)
% Button pushed function: PreviewButton
function PreviewButtonPushed(app, event)
% Create GUIDE-style callback args – Added by Migration Tool
[hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok<ASGLU>
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles = guidata(hObject);
% Frequency
freq = app.Frequency.Value * 10^9;
lambda = physconst(‘LightSpeed’) * 1000 / freq;
k = 2 * pi / lambda;
ix = 1;
iy = 1;
% Sample data (Replace with actual data assignment)
data = [140 0.2; 130 1.5; 0 2.5; -150 3.5; -175 4.5];
phas_u = data(:,1)’;
dim_u = data(:,2)’;
the_dir = app.Elevation.Value;
phi_dir = app.Azimuth.Value;
pha_zer = app.PhaseReference.Value;
x_cor = app.x.Value;
y_cor = app.y.Value;
z_cor = app.z.Value;
rad = app.Antennaradius.Value;
uedimx = app.X.Value;
uedimy = app.Y.Value;
% Initialize phase array
phase = zeros(round(rad/uedimx), round(rad/uedimy));
for xi = -rad/2+mod(rad/2,uedimx):uedimx:rad/2
for yi = -rad/2+mod(rad/2,uedimy):uedimy:rad/2
if sqrt(xi^2+yi^2) < rad/2
R = sqrt((x_cor-xi)^2 + (y_cor-yi)^2 + z_cor^2);
phase(ix, iy) = k * (R – sind(the_dir) * (xi * cosd(phi_dir) + yi * sind(phi_dir))) + pha_zer;
m_phase = mod(phase(ix, iy), 2*pi);
m_phase_deg = m_phase * 180 / pi – 180;
if m_phase_deg > phas_u(1,1)
phas_lin_map = phas_u(1,1);
elseif m_phase_deg < phas_u(1,end)
phas_lin_map = phas_u(end,1);
else
dy = diff([0 phas_u]);
dyix = find(dy == 0);
dim_u(dyix) = dim_u(dyix-1) + 1E-8;
phas_lin_map = interp1(phas_u, dim_u, m_phase_deg);
end
else
phase(ix, iy) = 0;
end
iy = iy + 1;
end
ix = ix + 1;
iy = 1;
end
% Convert to degrees
m_phase = mod(phase, 2*pi);
m_phase_deg = m_phase * 180 / pi;
% Debugging
disp(‘Phase (degrees):’);
disp(m_phase_deg);
% Plotting
surf(app.UIAxes, m_phase_deg);
view(app.UIAxes, 2);
guidata(hObject, handles);
end
end
% Close request function: UIFigure
function UIFigureCloseRequest(app, event)
delete(app)
end
% Value changed function: EditField2
function EditField2ValueChanged(app, event)
value = app.EditField2.Value;
end
end
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Get the file path for locating images
pathToMLAPP = fileparts(mfilename(‘fullpath’));
% Create UIFigure and hide until all components are created
app.UIFigure = uifigure(‘Visible’, ‘off’);
app.UIFigure.Color = [0.502 0.502 0.502];
app.UIFigure.Position = [100 100 984 624];
app.UIFigure.Name = ‘MATLAB App’;
app.UIFigure.CloseRequestFcn = createCallbackFcn(app, @UIFigureCloseRequest, true);
% Create Toolbar
app.Toolbar = uitoolbar(app.UIFigure);
% Create PushTool
app.PushTool = uipushtool(app.Toolbar);
app.PushTool.Icon = fullfile(pathToMLAPP, ‘images.png’);
% Create UIAxes
app.UIAxes = uiaxes(app.UIFigure);
app.UIAxes.XColor = [0 0 0];
app.UIAxes.Position = [602 321 329 262];
% Create DesignareflectarrayLabel
app.DesignareflectarrayLabel = uilabel(app.UIFigure);
app.DesignareflectarrayLabel.FontSize = 24;
app.DesignareflectarrayLabel.FontWeight = ‘bold’;
app.DesignareflectarrayLabel.Position = [363 593 261 32];
app.DesignareflectarrayLabel.Text = ‘Design a reflectarray ‘;
% Create AntennaradiusEditFieldLabel
app.AntennaradiusEditFieldLabel = uilabel(app.UIFigure);
app.AntennaradiusEditFieldLabel.HorizontalAlignment = ‘center’;
app.AntennaradiusEditFieldLabel.Position = [22 553 53 30];
app.AntennaradiusEditFieldLabel.Text = {‘Antenna ‘; ‘radius’};
% Create Antennaradius
app.Antennaradius = uieditfield(app.UIFigure, ‘numeric’);
app.Antennaradius.ValueChangedFcn = createCallbackFcn(app, @AntennaradiusEditFieldValueChanged, true);
app.Antennaradius.Position = [90 561 100 22];
% Create FrequencyEditFieldLabel
app.FrequencyEditFieldLabel = uilabel(app.UIFigure);
app.FrequencyEditFieldLabel.HorizontalAlignment = ‘right’;
app.FrequencyEditFieldLabel.Position = [10 522 65 22];
app.FrequencyEditFieldLabel.Text = ‘Frequency ‘;
% Create Frequency
app.Frequency = uieditfield(app.UIFigure, ‘numeric’);
app.Frequency.RoundFractionalValues = ‘on’;
app.Frequency.ValueChangedFcn = createCallbackFcn(app, @AntennaradiusEditFieldValueChanged, true);
app.Frequency.Position = [90 522 100 22];
% Create Image
app.Image = uiimage(app.UIFigure);
app.Image.Position = [231 345 370 219];
app.Image.ImageSource = fullfile(pathToMLAPP, ‘images.png’);
% Create xEditFieldLabel
app.xEditFieldLabel = uilabel(app.UIFigure);
app.xEditFieldLabel.HorizontalAlignment = ‘right’;
app.xEditFieldLabel.Position = [30 447 25 22];
app.xEditFieldLabel.Text = ‘x’;
% Create x
app.x = uieditfield(app.UIFigure, ‘numeric’);
app.x.Position = [70 447 100 22];
% Create yEditFieldLabel
app.yEditFieldLabel = uilabel(app.UIFigure);
app.yEditFieldLabel.HorizontalAlignment = ‘right’;
app.yEditFieldLabel.Position = [30 402 25 22];
app.yEditFieldLabel.Text = ‘y’;
% Create y
app.y = uieditfield(app.UIFigure, ‘numeric’);
app.y.Position = [70 402 100 22];
% Create zEditFieldLabel
app.zEditFieldLabel = uilabel(app.UIFigure);
app.zEditFieldLabel.HorizontalAlignment = ‘right’;
app.zEditFieldLabel.Position = [30 360 25 22];
app.zEditFieldLabel.Text = ‘z’;
% Create z
app.z = uieditfield(app.UIFigure, ‘numeric’);
app.z.Position = [70 360 100 22];
% Create PhaseCenterCoordinates
app.PhaseCenterCoordinates = uilabel(app.UIFigure);
app.PhaseCenterCoordinates.FontSize = 14;
app.PhaseCenterCoordinates.Position = [22 489 170 22];
app.PhaseCenterCoordinates.Text = ‘Phase Center Coordinates’;
% Create ElevationEditFieldLabel
app.ElevationEditFieldLabel = uilabel(app.UIFigure);
app.ElevationEditFieldLabel.HorizontalAlignment = ‘right’;
app.ElevationEditFieldLabel.Position = [15 285 54 22];
app.ElevationEditFieldLabel.Text = ‘Elevation’;
% Create Elevation
app.Elevation = uieditfield(app.UIFigure, ‘numeric’);
app.Elevation.Position = [84 285 64 22];
% Create AzimuthEditFieldLabel
app.AzimuthEditFieldLabel = uilabel(app.UIFigure);
app.AzimuthEditFieldLabel.HorizontalAlignment = ‘right’;
app.AzimuthEditFieldLabel.Position = [15 255 48 22];
app.AzimuthEditFieldLabel.Text = ‘Azimuth’;
% Create Azimuth
app.Azimuth = uieditfield(app.UIFigure, ‘numeric’);
app.Azimuth.Position = [84 255 64 22];
% Create BeamDirectionLabel
app.BeamDirectionLabel = uilabel(app.UIFigure);
app.BeamDirectionLabel.FontSize = 14;
app.BeamDirectionLabel.Position = [10 321 101 22];
app.BeamDirectionLabel.Text = ‘Beam Direction’;
% Create XEditFieldLabel
app.XEditFieldLabel = uilabel(app.UIFigure);
app.XEditFieldLabel.HorizontalAlignment = ‘right’;
app.XEditFieldLabel.Position = [31 174 25 22];
app.XEditFieldLabel.Text = ‘X’;
% Create X
app.X = uieditfield(app.UIFigure, ‘numeric’);
app.X.Position = [71 174 98 22];
% Create YEditFieldLabel
app.YEditFieldLabel = uilabel(app.UIFigure);
app.YEditFieldLabel.HorizontalAlignment = ‘right’;
app.YEditFieldLabel.Position = [29 126 25 22];
app.YEditFieldLabel.Text = ‘Y’;
% Create Y
app.Y = uieditfield(app.UIFigure, ‘numeric’);
app.Y.Position = [69 126 100 22];
% Create UnitElementDimensionsLabel
app.UnitElementDimensionsLabel = uilabel(app.UIFigure);
app.UnitElementDimensionsLabel.FontSize = 14;
app.UnitElementDimensionsLabel.Position = [15 216 162 22];
app.UnitElementDimensionsLabel.Text = ‘Unit Element Dimensions’;
% Create PhaseReferenceEditFieldLabel
app.PhaseReferenceEditFieldLabel = uilabel(app.UIFigure);
app.PhaseReferenceEditFieldLabel.HorizontalAlignment = ‘right’;
app.PhaseReferenceEditFieldLabel.Position = [9 83 98 22];
app.PhaseReferenceEditFieldLabel.Text = ‘Phase Reference’;
% Create PhaseReference
app.PhaseReference = uieditfield(app.UIFigure, ‘numeric’);
app.PhaseReference.Position = [130 83 58 22];
% Create PreviewButton
app.PreviewButton = uibutton(app.UIFigure, ‘push’);
app.PreviewButton.ButtonPushedFcn = createCallbackFcn(app, @PreviewButtonPushed, true);
app.PreviewButton.FontSize = 14;
app.PreviewButton.Position = [731 250 110 25];
app.PreviewButton.Text = ‘Preview’;
% Create CSTButton
app.CSTButton = uibutton(app.UIFigure, ‘push’);
app.CSTButton.ButtonPushedFcn = createCallbackFcn(app, @CSTButtonPushed, true);
app.CSTButton.FontSize = 14;
app.CSTButton.Position = [731 160 110 25];
app.CSTButton.Text = ‘ CST’;
% Create DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel = uilabel(app.UIFigure);
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel.BackgroundColor = [0.651 0.651 0.651];
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel.FontSize = 14;
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel.Position = [661 39 260 76];
app.DesigenerEngAbdullahSabahIbrahimuabd704gmailcomLabel.Text = {‘Desigener Eng .Abdullah Sabah Ibrahim’; ‘Air Navigation Engineer’; ‘uabd704@gmail.com’};
% Create ElementDataLabel
app.ElementDataLabel = uilabel(app.UIFigure);
app.ElementDataLabel.BackgroundColor = [0.502 0.502 0.502];
app.ElementDataLabel.FontSize = 14;
app.ElementDataLabel.Position = [320 310 142 27];
app.ElementDataLabel.Text = ‘Element Data’;
% Create PhaseLabel
app.PhaseLabel = uilabel(app.UIFigure);
app.PhaseLabel.Position = [326 281 39 22];
app.PhaseLabel.Text = ‘Phase’;
% Create DimensionPrpertyLabel
app.DimensionPrpertyLabel = uilabel(app.UIFigure);
app.DimensionPrpertyLabel.Position = [461 276 104 22];
app.DimensionPrpertyLabel.Text = ‘Dimension/Prperty’;
% Create EditField2
app.EditField2 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2.ValueChangedFcn = createCallbackFcn(app, @EditField2ValueChanged, true);
app.EditField2.Position = [461 242 100 22];
app.EditField2.Value = 0.2;
% Create EditField3
app.EditField3 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3.Position = [321 243 100 22];
app.EditField3.Value = 140;
% Create EditField3_2
app.EditField3_2 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3_2.Position = [320.997694832939 203.000512259345 100 22];
app.EditField3_2.Value = 130;
% Create EditField3_3
app.EditField3_3 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3_3.Position = [320.995929173063 161.393369402201 100 22];
% Create EditField2_2
app.EditField2_2 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2_2.Position = [461 203 100 22];
app.EditField2_2.Value = 1.5;
% Create EditField2_3
app.EditField2_3 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2_3.Position = [461 163 100 22];
app.EditField2_3.Value = 2.5;
% Create EditField3_4
app.EditField3_4 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3_4.Position = [321 123 100 22];
app.EditField3_4.Value = -150;
% Create EditField2_4
app.EditField2_4 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2_4.Position = [460.107943943571 122.820894513809 100 22];
app.EditField2_4.Value = 3.5;
% Create EditField2_5
app.EditField2_5 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField2_5.Position = [461 83 100 22];
app.EditField2_5.Value = 4.5;
% Create EditField3_5
app.EditField3_5 = uieditfield(app.UIFigure, ‘numeric’);
app.EditField3_5.Position = [320.997989109585 81.5705348423533 100 22];
app.EditField3_5.Value = -175;
% Show the figure after all components are created
app.UIFigure.Visible = ‘on’;
end
end
% App creation and deletion
methods (Access = public)
% Construct app
function app = app1
% Create UIFigure and components
createComponents(app)
% Register the app with App Designer
registerApp(app, app.UIFigure)
if nargout == 0
clear app
end
end
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
delete(app.UIFigure)
end
end
end app designer MATLAB Answers — New Questions
​
hi, find the value of x theoretically?
find the value of x?
((log(1-exp(-x/s)^(n))-log(1-a^(1-exp(-x/s)^(n))))/(1-a))=1/2find the value of x?
((log(1-exp(-x/s)^(n))-log(1-a^(1-exp(-x/s)^(n))))/(1-a))=1/2Â find the value of x?
((log(1-exp(-x/s)^(n))-log(1-a^(1-exp(-x/s)^(n))))/(1-a))=1/2 exp, alpha MATLAB Answers — New Questions
​
Facing problem during simulation on gazebo.
Hi I am trying to simulate this problem https://www.mathworks.com/matlabcentral/fileexchange/64381-matlab-and-simulink-robotics-arena-simulating-quadcopter-missions I have tried virtual box then VMware and after that I have download the files from this link https://www.mathworks.com/support/product/robotics/ros2-vm-installation-instructions-v5.html now the problem I am facing in all these cases is same when I run my simulation in gazebo I am facing errors in importing drone into the world loaded in my scenario. I have already connected simulink with ROS and works fine but my errors come in linux terminal.
Note: I have already followed steps according to documentation provided and tried videos too available on youtube and matlab platform. I have tried diffrent versions of ROS including latest version also ( ROS Noetic Humble Gazebo 11 and ROS Melodic Dashing Gazebov9 ) in a hope maybe old version might help me out in this problem but the error is consistent no matter what I try.
The Error I am facing are of the sort:
qws.urdf file is empty.
[INFO] [1723726120.533970, 0.000000]: Calling service /gazebo/spawn_urdf_model Service call failed: service [/gazebo/spawn_urdf_model] responded with an error: [ERROR] [1723726120.622680, 65.204000]: Spawn service failed. Exiting.
xacro: in-order processing became default in ROS Melodic. You can drop the option. resource not found: imav_2017 ROS path [0]=/opt/ros/melodic/share/ros ROS path [1]=/opt/ros/melodic/share when processing file: quadrotor.urdf.xacro [INFO] [1723726204.610146, 0.000000]: Loading model XML from file qws.urdf [ERROR] [1723726204.611562, 0.000000]: Error: file qws.urdf is emptyHi I am trying to simulate this problem https://www.mathworks.com/matlabcentral/fileexchange/64381-matlab-and-simulink-robotics-arena-simulating-quadcopter-missions I have tried virtual box then VMware and after that I have download the files from this link https://www.mathworks.com/support/product/robotics/ros2-vm-installation-instructions-v5.html now the problem I am facing in all these cases is same when I run my simulation in gazebo I am facing errors in importing drone into the world loaded in my scenario. I have already connected simulink with ROS and works fine but my errors come in linux terminal.
Note: I have already followed steps according to documentation provided and tried videos too available on youtube and matlab platform. I have tried diffrent versions of ROS including latest version also ( ROS Noetic Humble Gazebo 11 and ROS Melodic Dashing Gazebov9 ) in a hope maybe old version might help me out in this problem but the error is consistent no matter what I try.
The Error I am facing are of the sort:
qws.urdf file is empty.
[INFO] [1723726120.533970, 0.000000]: Calling service /gazebo/spawn_urdf_model Service call failed: service [/gazebo/spawn_urdf_model] responded with an error: [ERROR] [1723726120.622680, 65.204000]: Spawn service failed. Exiting.
xacro: in-order processing became default in ROS Melodic. You can drop the option. resource not found: imav_2017 ROS path [0]=/opt/ros/melodic/share/ros ROS path [1]=/opt/ros/melodic/share when processing file: quadrotor.urdf.xacro [INFO] [1723726204.610146, 0.000000]: Loading model XML from file qws.urdf [ERROR] [1723726204.611562, 0.000000]: Error: file qws.urdf is empty Hi I am trying to simulate this problem https://www.mathworks.com/matlabcentral/fileexchange/64381-matlab-and-simulink-robotics-arena-simulating-quadcopter-missions I have tried virtual box then VMware and after that I have download the files from this link https://www.mathworks.com/support/product/robotics/ros2-vm-installation-instructions-v5.html now the problem I am facing in all these cases is same when I run my simulation in gazebo I am facing errors in importing drone into the world loaded in my scenario. I have already connected simulink with ROS and works fine but my errors come in linux terminal.
Note: I have already followed steps according to documentation provided and tried videos too available on youtube and matlab platform. I have tried diffrent versions of ROS including latest version also ( ROS Noetic Humble Gazebo 11 and ROS Melodic Dashing Gazebov9 ) in a hope maybe old version might help me out in this problem but the error is consistent no matter what I try.
The Error I am facing are of the sort:
qws.urdf file is empty.
[INFO] [1723726120.533970, 0.000000]: Calling service /gazebo/spawn_urdf_model Service call failed: service [/gazebo/spawn_urdf_model] responded with an error: [ERROR] [1723726120.622680, 65.204000]: Spawn service failed. Exiting.
xacro: in-order processing became default in ROS Melodic. You can drop the option. resource not found: imav_2017 ROS path [0]=/opt/ros/melodic/share/ros ROS path [1]=/opt/ros/melodic/share when processing file: quadrotor.urdf.xacro [INFO] [1723726204.610146, 0.000000]: Loading model XML from file qws.urdf [ERROR] [1723726204.611562, 0.000000]: Error: file qws.urdf is empty gazebo, uav simulation, ros, linux, ubuntu, robotics arena quadcopter missions MATLAB Answers — New Questions
​
Regarding the execution time in the ‘Simulink Support Package for Arduino Hardware’
Hello,
I have some questions regarding the execution time in the ‘Simulink Support Package for Arduino Hardware’.
Q1. If I want to run a Simulink model at 100Hz on Arduino Hardware, should I set the Fixed-step size to 10ms in the Solver details? (My model is based on sensor values)
Q2. Or my model is based on sensor values, and I want it to run at 100Hz. In this case, should I set the sample time of the I2C controller read block to 10ms?
Q3. What happens if the execution time of my model exceeds 10ms (an overrun occurs)?
For example, let’s assume that the model operates based on sensor values received (start model) every 10ms. If the algorithm takes 15ms to run, I see two possible options:
The algorithm runs with the sensor values from time t, and the sensor values from t+10ms are discarded (since the algorithm is still running), and the algorithm runs again with the sensor values from t+20ms.
The algorithm runs with the sensor values from time t, and as soon as the algorithm finishes, it starts again with the sensor values from t+10ms at t+15ms.
Which one happens? I believe it is option 1.
If someone knows, please provide an answer.
Thank you.Hello,
I have some questions regarding the execution time in the ‘Simulink Support Package for Arduino Hardware’.
Q1. If I want to run a Simulink model at 100Hz on Arduino Hardware, should I set the Fixed-step size to 10ms in the Solver details? (My model is based on sensor values)
Q2. Or my model is based on sensor values, and I want it to run at 100Hz. In this case, should I set the sample time of the I2C controller read block to 10ms?
Q3. What happens if the execution time of my model exceeds 10ms (an overrun occurs)?
For example, let’s assume that the model operates based on sensor values received (start model) every 10ms. If the algorithm takes 15ms to run, I see two possible options:
The algorithm runs with the sensor values from time t, and the sensor values from t+10ms are discarded (since the algorithm is still running), and the algorithm runs again with the sensor values from t+20ms.
The algorithm runs with the sensor values from time t, and as soon as the algorithm finishes, it starts again with the sensor values from t+10ms at t+15ms.
Which one happens? I believe it is option 1.
If someone knows, please provide an answer.
Thank you. Hello,
I have some questions regarding the execution time in the ‘Simulink Support Package for Arduino Hardware’.
Q1. If I want to run a Simulink model at 100Hz on Arduino Hardware, should I set the Fixed-step size to 10ms in the Solver details? (My model is based on sensor values)
Q2. Or my model is based on sensor values, and I want it to run at 100Hz. In this case, should I set the sample time of the I2C controller read block to 10ms?
Q3. What happens if the execution time of my model exceeds 10ms (an overrun occurs)?
For example, let’s assume that the model operates based on sensor values received (start model) every 10ms. If the algorithm takes 15ms to run, I see two possible options:
The algorithm runs with the sensor values from time t, and the sensor values from t+10ms are discarded (since the algorithm is still running), and the algorithm runs again with the sensor values from t+20ms.
The algorithm runs with the sensor values from time t, and as soon as the algorithm finishes, it starts again with the sensor values from t+10ms at t+15ms.
Which one happens? I believe it is option 1.
If someone knows, please provide an answer.
Thank you. simulink, simulink support package for arduino hardware, execution time, overrun MATLAB Answers — New Questions
​
Can’t get better interpolation at some points
Hi all,
I would be grateful if someone could help with the following matter:
I have a set of complex data called [a2norm_real and a2norm_imag (as per attached)], and another set of complex data was generated as shown in the code. I tried to achieve better interpolation for the Gain, but it fails at certain points (as per attached). No matter how many points I generate, it fails at the same place each time. I have tried different 1D and 2D interpolation methods (including the one below), but this was the best one I could achieve. Thanks!
Here is the code:
data2 = readtable(‘System Gain.xlsx’, ‘VariableNamingRule’, ‘preserve’);
% Process the second file
a2norm_real = data2{:, 5};
a2norm_imag = data2{:, 6};
a2norm_complx = complex(a2norm_real,a2norm_imag);
Gain = complex(data2{:, 1}, data2{:, 2});
a21_mag = linspace(min(abs(a2norm_complx)),max(abs(a2norm_complx)),31).’;
a21_ph = linspace(0,0,31).’;
a21_complx = a21_mag.*exp(1i*pi/180.*a21_ph);
% Perform the interpolation
Interp = griddata(a2norm_real, a2norm_imag, Gain, real(a21_complx), imag(a21_complx), ‘nearest’);
figure;
plot(abs(a2norm_complx), System_Gain, ‘o’, ‘DisplayName’, ‘System gain’);
hold on;
plot(abs(a21_target), System_Gain_Interp, ‘:*’, ‘DisplayName’, ‘System_Gain_Selected’);
legend(‘show’); % Displays the legend with the DisplayName labels
title(‘(Default) Linear Interpolation’);
grid on;
legend(‘Location’, ‘best’);Hi all,
I would be grateful if someone could help with the following matter:
I have a set of complex data called [a2norm_real and a2norm_imag (as per attached)], and another set of complex data was generated as shown in the code. I tried to achieve better interpolation for the Gain, but it fails at certain points (as per attached). No matter how many points I generate, it fails at the same place each time. I have tried different 1D and 2D interpolation methods (including the one below), but this was the best one I could achieve. Thanks!
Here is the code:
data2 = readtable(‘System Gain.xlsx’, ‘VariableNamingRule’, ‘preserve’);
% Process the second file
a2norm_real = data2{:, 5};
a2norm_imag = data2{:, 6};
a2norm_complx = complex(a2norm_real,a2norm_imag);
Gain = complex(data2{:, 1}, data2{:, 2});
a21_mag = linspace(min(abs(a2norm_complx)),max(abs(a2norm_complx)),31).’;
a21_ph = linspace(0,0,31).’;
a21_complx = a21_mag.*exp(1i*pi/180.*a21_ph);
% Perform the interpolation
Interp = griddata(a2norm_real, a2norm_imag, Gain, real(a21_complx), imag(a21_complx), ‘nearest’);
figure;
plot(abs(a2norm_complx), System_Gain, ‘o’, ‘DisplayName’, ‘System gain’);
hold on;
plot(abs(a21_target), System_Gain_Interp, ‘:*’, ‘DisplayName’, ‘System_Gain_Selected’);
legend(‘show’); % Displays the legend with the DisplayName labels
title(‘(Default) Linear Interpolation’);
grid on;
legend(‘Location’, ‘best’);Â Hi all,
I would be grateful if someone could help with the following matter:
I have a set of complex data called [a2norm_real and a2norm_imag (as per attached)], and another set of complex data was generated as shown in the code. I tried to achieve better interpolation for the Gain, but it fails at certain points (as per attached). No matter how many points I generate, it fails at the same place each time. I have tried different 1D and 2D interpolation methods (including the one below), but this was the best one I could achieve. Thanks!
Here is the code:
data2 = readtable(‘System Gain.xlsx’, ‘VariableNamingRule’, ‘preserve’);
% Process the second file
a2norm_real = data2{:, 5};
a2norm_imag = data2{:, 6};
a2norm_complx = complex(a2norm_real,a2norm_imag);
Gain = complex(data2{:, 1}, data2{:, 2});
a21_mag = linspace(min(abs(a2norm_complx)),max(abs(a2norm_complx)),31).’;
a21_ph = linspace(0,0,31).’;
a21_complx = a21_mag.*exp(1i*pi/180.*a21_ph);
% Perform the interpolation
Interp = griddata(a2norm_real, a2norm_imag, Gain, real(a21_complx), imag(a21_complx), ‘nearest’);
figure;
plot(abs(a2norm_complx), System_Gain, ‘o’, ‘DisplayName’, ‘System gain’);
hold on;
plot(abs(a21_target), System_Gain_Interp, ‘:*’, ‘DisplayName’, ‘System_Gain_Selected’);
legend(‘show’); % Displays the legend with the DisplayName labels
title(‘(Default) Linear Interpolation’);
grid on;
legend(‘Location’, ‘best’); interpolation MATLAB Answers — New Questions
​
How to define the tire and ground contact for tire enveloping characteristics in Simscape Multibody (to simulate the tire driving over an obstacle)?
Hi, I have question regarding the tire and the ground contact in Simscape Multibody. From the contact forces library I am able to define the contact, but it is a point contact and secondly the wheel does not have tire enveloping behavior, when it comes in contact with an obstacle. The point follows the obstacle as it is, which should not be the case for the simulation.
It will be great help, if anyone suggest me the solution for the described problem?
And thank you very much for the contact force library. It is very helpful :)Hi, I have question regarding the tire and the ground contact in Simscape Multibody. From the contact forces library I am able to define the contact, but it is a point contact and secondly the wheel does not have tire enveloping behavior, when it comes in contact with an obstacle. The point follows the obstacle as it is, which should not be the case for the simulation.
It will be great help, if anyone suggest me the solution for the described problem?
And thank you very much for the contact force library. It is very helpful 🙂 Hi, I have question regarding the tire and the ground contact in Simscape Multibody. From the contact forces library I am able to define the contact, but it is a point contact and secondly the wheel does not have tire enveloping behavior, when it comes in contact with an obstacle. The point follows the obstacle as it is, which should not be the case for the simulation.
It will be great help, if anyone suggest me the solution for the described problem?
And thank you very much for the contact force library. It is very helpful 🙂 tire, tire envelope, rolling over an obstacle, tire contact behavior MATLAB Answers — New Questions
​
Write MuPAD code to produce a graph of two circles, radii 2 and 3, with the centre of the smaller circle at (x = −2, y = 1) and the centre of the larger circle at (x = 3, y =
Write MuPAD code to produce a graph of two circles, radii 2 and 3, with the centre of the smaller circle at (x = -2, y = 1) and the centre of the larger circle at (x = 3, y = 1). The axes should be labelled appropriately, and there should be suitable titles for each circle, and for the scene. The colour of the smaller circle should be red and that of the larger circle should be blue.Write MuPAD code to produce a graph of two circles, radii 2 and 3, with the centre of the smaller circle at (x = -2, y = 1) and the centre of the larger circle at (x = 3, y = 1). The axes should be labelled appropriately, and there should be suitable titles for each circle, and for the scene. The colour of the smaller circle should be red and that of the larger circle should be blue. Write MuPAD code to produce a graph of two circles, radii 2 and 3, with the centre of the smaller circle at (x = -2, y = 1) and the centre of the larger circle at (x = 3, y = 1). The axes should be labelled appropriately, and there should be suitable titles for each circle, and for the scene. The colour of the smaller circle should be red and that of the larger circle should be blue. mupad MATLAB Answers — New Questions
​
How to debug a suddenly closing/crashing appdesigner app
I am working on an more or less complex appdesigner application wich controls a test stand in a laboratory. So I can not give an example or reproduce the error.
After a random runtime of 10 min. to 2 h the app closes without any message, so I am not sure if I should call this a "crash". The first error message comes from a listener that can not execute since the object was deleted.
By setting a breakpoint in the delete(app) function, created by appdesigner, I was able get a callstack.
"MyApp.mlapp fcn: MyApp.delete ;line 1686"
"FigureController.m fcn: FigureController.onViewKilled ;line 820"
"FigurePlatformHost.m fcn: FigurePlatformHost.onViewKilled ;line 59"
"CEFFigurePlatformHost.m fcn: @(event,data)this.onViewKilled() ;line 94"
"Callback.m fcn: Callback.execute ;line 128"
"webwindow.m fcn: webwindow.onCustomEvent ;line 1528"
"webwindow.m fcn: @(source,data)obj.onCustomEvent(data.Type,data.Data) ;line 349"
"Channel.m fcn: Channel.onCustomEvent ;line 575"
"Channel.m fcn: @(source,data)obj.onCustomEvent(data.Type,data.Data) ;line 473"
The Channel file is +matlabshared+asyncio+internalChannel.m
In the last line of the callstack, the "Custom" Event of the Channel is raised. The event data is
data.Type = "processExit"
data.Data = struct with fields: exitStatus: 3
The event source is a asyncioimpl.Channel, which is a c++ implementation of the Channel and the debugger can not look into this.
Is there any way of tracing the cause of this error?
Thank you for your help!I am working on an more or less complex appdesigner application wich controls a test stand in a laboratory. So I can not give an example or reproduce the error.
After a random runtime of 10 min. to 2 h the app closes without any message, so I am not sure if I should call this a "crash". The first error message comes from a listener that can not execute since the object was deleted.
By setting a breakpoint in the delete(app) function, created by appdesigner, I was able get a callstack.
"MyApp.mlapp fcn: MyApp.delete ;line 1686"
"FigureController.m fcn: FigureController.onViewKilled ;line 820"
"FigurePlatformHost.m fcn: FigurePlatformHost.onViewKilled ;line 59"
"CEFFigurePlatformHost.m fcn: @(event,data)this.onViewKilled() ;line 94"
"Callback.m fcn: Callback.execute ;line 128"
"webwindow.m fcn: webwindow.onCustomEvent ;line 1528"
"webwindow.m fcn: @(source,data)obj.onCustomEvent(data.Type,data.Data) ;line 349"
"Channel.m fcn: Channel.onCustomEvent ;line 575"
"Channel.m fcn: @(source,data)obj.onCustomEvent(data.Type,data.Data) ;line 473"
The Channel file is +matlabshared+asyncio+internalChannel.m
In the last line of the callstack, the "Custom" Event of the Channel is raised. The event data is
data.Type = "processExit"
data.Data = struct with fields: exitStatus: 3
The event source is a asyncioimpl.Channel, which is a c++ implementation of the Channel and the debugger can not look into this.
Is there any way of tracing the cause of this error?
Thank you for your help! I am working on an more or less complex appdesigner application wich controls a test stand in a laboratory. So I can not give an example or reproduce the error.
After a random runtime of 10 min. to 2 h the app closes without any message, so I am not sure if I should call this a "crash". The first error message comes from a listener that can not execute since the object was deleted.
By setting a breakpoint in the delete(app) function, created by appdesigner, I was able get a callstack.
"MyApp.mlapp fcn: MyApp.delete ;line 1686"
"FigureController.m fcn: FigureController.onViewKilled ;line 820"
"FigurePlatformHost.m fcn: FigurePlatformHost.onViewKilled ;line 59"
"CEFFigurePlatformHost.m fcn: @(event,data)this.onViewKilled() ;line 94"
"Callback.m fcn: Callback.execute ;line 128"
"webwindow.m fcn: webwindow.onCustomEvent ;line 1528"
"webwindow.m fcn: @(source,data)obj.onCustomEvent(data.Type,data.Data) ;line 349"
"Channel.m fcn: Channel.onCustomEvent ;line 575"
"Channel.m fcn: @(source,data)obj.onCustomEvent(data.Type,data.Data) ;line 473"
The Channel file is +matlabshared+asyncio+internalChannel.m
In the last line of the callstack, the "Custom" Event of the Channel is raised. The event data is
data.Type = "processExit"
data.Data = struct with fields: exitStatus: 3
The event source is a asyncioimpl.Channel, which is a c++ implementation of the Channel and the debugger can not look into this.
Is there any way of tracing the cause of this error?
Thank you for your help! appdesigner, debug, crash MATLAB Answers — New Questions
​
Crosstab by using the same input for both arguments
If I run one of the examples of crosstab, I get the same result as indicated in the crosstab webpage:
rng default; % for reproducibility
x1 = unidrnd(3,50,1);
x2 = unidrnd(3,50,1);
[table,chi2,p] = crosstab(x1,x2)
However, if I use the same input for both arguments of crosstab, I get a p-value basically equal to zero:
rng default; % for reproducibility
x1 = unidrnd(3,50,1);
x2 = unidrnd(3,50,1);
[table,chi2,p] = crosstab(x1,x1)
Shouldn’t I get a p-value higher if I use the same input for both argument of crosstab? (I was thinking about a p-value close to 1 actually)If I run one of the examples of crosstab, I get the same result as indicated in the crosstab webpage:
rng default; % for reproducibility
x1 = unidrnd(3,50,1);
x2 = unidrnd(3,50,1);
[table,chi2,p] = crosstab(x1,x2)
However, if I use the same input for both arguments of crosstab, I get a p-value basically equal to zero:
rng default; % for reproducibility
x1 = unidrnd(3,50,1);
x2 = unidrnd(3,50,1);
[table,chi2,p] = crosstab(x1,x1)
Shouldn’t I get a p-value higher if I use the same input for both argument of crosstab? (I was thinking about a p-value close to 1 actually)Â If I run one of the examples of crosstab, I get the same result as indicated in the crosstab webpage:
rng default; % for reproducibility
x1 = unidrnd(3,50,1);
x2 = unidrnd(3,50,1);
[table,chi2,p] = crosstab(x1,x2)
However, if I use the same input for both arguments of crosstab, I get a p-value basically equal to zero:
rng default; % for reproducibility
x1 = unidrnd(3,50,1);
x2 = unidrnd(3,50,1);
[table,chi2,p] = crosstab(x1,x1)
Shouldn’t I get a p-value higher if I use the same input for both argument of crosstab? (I was thinking about a p-value close to 1 actually) crosstab, p-value MATLAB Answers — New Questions
​
Problem during runing the Ansys in batch mode
I have installed student trial version of Matlab and Ansys. During the calculation in Matlab from which I run Ansys in batch mode, there is an error.
While, during the calculation the following error occure
Abort(100) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 100) – process 0I have installed student trial version of Matlab and Ansys. During the calculation in Matlab from which I run Ansys in batch mode, there is an error.
While, during the calculation the following error occure
Abort(100) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 100) – process 0Â I have installed student trial version of Matlab and Ansys. During the calculation in Matlab from which I run Ansys in batch mode, there is an error.
While, during the calculation the following error occure
Abort(100) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 100) – process 0 optimization, parallel computing, algorithm, genetic algorithm MATLAB Answers — New Questions
​
I am trying to solve the system of coupled partial differential equations described in the attachment using the function pdepe. My code runs into this error:
function [c,f,s] = pdefun(x,t,u,dudx) % Equation to solve
c = [1; 1];
f = [-0.6; 1.32].*u;
s = [0; 0];
end
function u0 = pdeic(x) % Initial Conditions
u0 = [sin(pi*x); sin(pi*x)];
end
function [pl,ql,pr,qr] = pdebc(xl,ul,xr,ur,t) % Boundary Conditions
pl = [2.2*ul(2)+ ul(1); 0];
ql = [0; 0];
pr = [0; ur(2)];
qr = [0; 0];
end
x = linspace(0,1,50);
t = linspace(0,2,50);
m = 0;
sol = pdepe(m,@pdefun,@pdeic,@pdebc,x,t);
u1 = sol(:,:,1);
u2 = sol(:,:,2);
surf(x,t,u1)
title(‘u_(x,t)’)
xlabel(‘Distance x’)
ylabel(‘Time t’)function [c,f,s] = pdefun(x,t,u,dudx) % Equation to solve
c = [1; 1];
f = [-0.6; 1.32].*u;
s = [0; 0];
end
function u0 = pdeic(x) % Initial Conditions
u0 = [sin(pi*x); sin(pi*x)];
end
function [pl,ql,pr,qr] = pdebc(xl,ul,xr,ur,t) % Boundary Conditions
pl = [2.2*ul(2)+ ul(1); 0];
ql = [0; 0];
pr = [0; ur(2)];
qr = [0; 0];
end
x = linspace(0,1,50);
t = linspace(0,2,50);
m = 0;
sol = pdepe(m,@pdefun,@pdeic,@pdebc,x,t);
u1 = sol(:,:,1);
u2 = sol(:,:,2);
surf(x,t,u1)
title(‘u_(x,t)’)
xlabel(‘Distance x’)
ylabel(‘Time t’)Â function [c,f,s] = pdefun(x,t,u,dudx) % Equation to solve
c = [1; 1];
f = [-0.6; 1.32].*u;
s = [0; 0];
end
function u0 = pdeic(x) % Initial Conditions
u0 = [sin(pi*x); sin(pi*x)];
end
function [pl,ql,pr,qr] = pdebc(xl,ul,xr,ur,t) % Boundary Conditions
pl = [2.2*ul(2)+ ul(1); 0];
ql = [0; 0];
pr = [0; ur(2)];
qr = [0; 0];
end
x = linspace(0,1,50);
t = linspace(0,2,50);
m = 0;
sol = pdepe(m,@pdefun,@pdeic,@pdebc,x,t);
u1 = sol(:,:,1);
u2 = sol(:,:,2);
surf(x,t,u1)
title(‘u_(x,t)’)
xlabel(‘Distance x’)
ylabel(‘Time t’) pde, pdepe MATLAB Answers — New Questions
​
How do I use the unit per mille in Simulink parameters and ports?
In simulink parameters and ports can be specified to use units as described here: https://se.mathworks.com/help/simulink/ug/units-in-simulink.html
For dimensionless pure scaled numbers percent (1e-2), ppm (1e-6), ppb (1e-9) and ppt (1e-12) can be used. But is there a way to specify per mille (‰)? Using 0.001 does not work.In simulink parameters and ports can be specified to use units as described here: https://se.mathworks.com/help/simulink/ug/units-in-simulink.html
For dimensionless pure scaled numbers percent (1e-2), ppm (1e-6), ppb (1e-9) and ppt (1e-12) can be used. But is there a way to specify per mille (‰)? Using 0.001 does not work. In simulink parameters and ports can be specified to use units as described here: https://se.mathworks.com/help/simulink/ug/units-in-simulink.html
For dimensionless pure scaled numbers percent (1e-2), ppm (1e-6), ppb (1e-9) and ppt (1e-12) can be used. But is there a way to specify per mille (‰)? Using 0.001 does not work. per_mille, units, per mille, unit MATLAB Answers — New Questions
​
Want to show the csv results on the App panel. getting error in app The entries in tspan must strictly increase or decrease. Kindly guide me
Want to show the csv results on the App panel.
getting error in app The entries in tspan must strictly increase or decrease.
Kindly guide meWant to show the csv results on the App panel.
getting error in app The entries in tspan must strictly increase or decrease.
Kindly guide me Want to show the csv results on the App panel.
getting error in app The entries in tspan must strictly increase or decrease.
Kindly guide me matlab gui MATLAB Answers — New Questions
​
unique across tables within table
Hello
I’ve got what in the screenshots below, so RawFileIndex is a table that contains Paramaters that is another table (or a 1×1 cell containing a table? I’m a bit confused…)
I want to know all the parameter ID accross all the files, something like unique(RawFileIndex.Parameters{:,1}.ID) but this is clearly not the right syntax… how do I do it?
thanksHello
I’ve got what in the screenshots below, so RawFileIndex is a table that contains Paramaters that is another table (or a 1×1 cell containing a table? I’m a bit confused…)
I want to know all the parameter ID accross all the files, something like unique(RawFileIndex.Parameters{:,1}.ID) but this is clearly not the right syntax… how do I do it?
thanks Hello
I’ve got what in the screenshots below, so RawFileIndex is a table that contains Paramaters that is another table (or a 1×1 cell containing a table? I’m a bit confused…)
I want to know all the parameter ID accross all the files, something like unique(RawFileIndex.Parameters{:,1}.ID) but this is clearly not the right syntax… how do I do it?
thanks unique, table MATLAB Answers — New Questions
​
Updated Matlab keep trying to update
Hi,
I have Matlab installed on Debian 12 and 4 days ago I update the installation to the last available version.
I usally works from the command line meaning that I open Matlab using
matlab -nodesktop -nosplash
I’ve been working like these for years.
However, lately at random moments I got a message saying: "Launching updater executable" on the command windows. Checking the monitor of resources there is process called "InstallMathWorksService Host" which is using 100% of one of my CPUs.
However, when I open the GUI and try to update Matlab says it’s up to date. Even if I close Matlab in the command windows, I still got the message about "launching update" randomly.
What can I do?
ThanksHi,
I have Matlab installed on Debian 12 and 4 days ago I update the installation to the last available version.
I usally works from the command line meaning that I open Matlab using
matlab -nodesktop -nosplash
I’ve been working like these for years.
However, lately at random moments I got a message saying: "Launching updater executable" on the command windows. Checking the monitor of resources there is process called "InstallMathWorksService Host" which is using 100% of one of my CPUs.
However, when I open the GUI and try to update Matlab says it’s up to date. Even if I close Matlab in the command windows, I still got the message about "launching update" randomly.
What can I do?
Thanks Hi,
I have Matlab installed on Debian 12 and 4 days ago I update the installation to the last available version.
I usally works from the command line meaning that I open Matlab using
matlab -nodesktop -nosplash
I’ve been working like these for years.
However, lately at random moments I got a message saying: "Launching updater executable" on the command windows. Checking the monitor of resources there is process called "InstallMathWorksService Host" which is using 100% of one of my CPUs.
However, when I open the GUI and try to update Matlab says it’s up to date. Even if I close Matlab in the command windows, I still got the message about "launching update" randomly.
What can I do?
Thanks update, linux MATLAB Answers — New Questions
​
get the whole sentence truncated
this is a checkBox in my app
i write in label "size MainStrum adaptive" but i see only "size Main S. a…"
because there is little space and it gets truncated
Is it possible when I go over it with the mouse it brings me the whole sentence?this is a checkBox in my app
i write in label "size MainStrum adaptive" but i see only "size Main S. a…"
because there is little space and it gets truncated
Is it possible when I go over it with the mouse it brings me the whole sentence? this is a checkBox in my app
i write in label "size MainStrum adaptive" but i see only "size Main S. a…"
because there is little space and it gets truncated
Is it possible when I go over it with the mouse it brings me the whole sentence? get the whole sentence truncated MATLAB Answers — New Questions
​
What licenses are required for running Polyspace code prover ?
Does Polyspace code prover require having both bug finder and code prover licenses ?
Does it also require having MATLAB license ? If yes, then which toolbox(es) are mandatory ?Does Polyspace code prover require having both bug finder and code prover licenses ?
Does it also require having MATLAB license ? If yes, then which toolbox(es) are mandatory ? Does Polyspace code prover require having both bug finder and code prover licenses ?
Does it also require having MATLAB license ? If yes, then which toolbox(es) are mandatory ? polyspace, code prover, license MATLAB Answers — New Questions
​
How to get input from a simulink model to .m file ?
I made a simulink model and linked it with interpreted matlab function block which has my .m code file, but I need 6 inputs to the .m file that are supposed to come from my model. What function do I use in my .m file to get values from my simulink model. As the interpreted function block has only one input, I have used a MUX.I made a simulink model and linked it with interpreted matlab function block which has my .m code file, but I need 6 inputs to the .m file that are supposed to come from my model. What function do I use in my .m file to get values from my simulink model. As the interpreted function block has only one input, I have used a MUX. I made a simulink model and linked it with interpreted matlab function block which has my .m code file, but I need 6 inputs to the .m file that are supposed to come from my model. What function do I use in my .m file to get values from my simulink model. As the interpreted function block has only one input, I have used a MUX. simulink to .m file MATLAB Answers — New Questions
​
how to download data from website?
Dear all,
I am trying to download data from the following website
https://oceandata.sci.gsfc.nasa.gov/MODIS-Aqua/Mapped/Daily/4km/sst/2019/
my problem is I can not get the files, meaning only the html been located to my computer. (below what I used to locat the link into my machine)
url=’https://oceandata.sci.gsfc.nasa.gov/MODIS-Aqua/Mapped/Daily/4km/sst/2019/’
filename=’A2019.nc’
outfilename=websave(filename,url)
what I need is getting the files separtly and read them.
Thanks for the help.Dear all,
I am trying to download data from the following website
https://oceandata.sci.gsfc.nasa.gov/MODIS-Aqua/Mapped/Daily/4km/sst/2019/
my problem is I can not get the files, meaning only the html been located to my computer. (below what I used to locat the link into my machine)
url=’https://oceandata.sci.gsfc.nasa.gov/MODIS-Aqua/Mapped/Daily/4km/sst/2019/’
filename=’A2019.nc’
outfilename=websave(filename,url)
what I need is getting the files separtly and read them.
Thanks for the help. Dear all,
I am trying to download data from the following website
https://oceandata.sci.gsfc.nasa.gov/MODIS-Aqua/Mapped/Daily/4km/sst/2019/
my problem is I can not get the files, meaning only the html been located to my computer. (below what I used to locat the link into my machine)
url=’https://oceandata.sci.gsfc.nasa.gov/MODIS-Aqua/Mapped/Daily/4km/sst/2019/’
filename=’A2019.nc’
outfilename=websave(filename,url)
what I need is getting the files separtly and read them.
Thanks for the help. for loop, download MATLAB Answers — New Questions
​