# IMPLEMENTATION OF ANTENNA ARRAY(CONCENTRIC CIRCULAR) USING MATLAB FUNCTION IN SIMULINK

4 ビュー (過去 30 日間)
FARHA KHAN 2021 年 10 月 4 日
コメント済み: FARHA KHAN 2021 年 10 月 4 日
Hi
I am tring to implement concentric circular arrays using simulink,phased array toolbox. Narrowband tx and rx array couldn't be used as they don't have concentric circular arrays as i/p , they have only (ura uca ula) .
So I thought as sensor array app gives the .m file of CCA, I can implement it by creating matlab function but they throwing errors.
Simulink does not have enough information to determine output sizes for this block. If you think the errors below are inaccurate, try specifying types for the block inputs and/or sizes for the block outputs.
I have attached the matlab code and block pls look into them and help
MATLAB CODE
shift = 0;
% The multiplication factor for lambda units to meter conversion
if length(n) == 1
end
Nelements = sum(n);
stop = cumsum(n);
start = stop - n + 1;
actual_pos = zeros(3, Nelements);
for idx = 1:length(n)
angles = (0:n(idx)-1)*360/n(idx);
angles = angles + shift;
shift = sum(angles(1:2))/2;
pos = [zeros(1, length(angles));cosd(angles);sind(angles)];
end
elNormal = [ones(1,Nelements);zeros(1,Nelements)];
Array = phased.ConformalArray('ElementPosition', actual_pos, ...
'ElementNormal', elNormal,'Taper',[exp(i*l2*0) exp(i*l2*1.5707) exp(i*l2*3.1415) exp(i*l2*4.7123) exp(i*l4*0) exp(i*l4*0.7853) exp(i*l4*1.5707) exp(i*l4*2.356) exp(i*l4*3.1415) exp(i*l4*3.9269) exp(i*l4*4.7123) exp(i*l4*5.4977)]);
% Create an isotropic antenna element
Elem = phased.IsotropicAntennaElement;
Elem.FrequencyRange = [0 28500000000];
Array.Element = Elem;
% Assign Frequencies and Propagation Speed
Frequency = 28500000000;
PropagationSpeed = 300000000;
% Create Figure
% Plot Array Geometry
figure;
viewArray(Array,'ShowNormal',false,...
'ShowTaper',false,'ShowIndex','None');
% Calculate Steering Weights
Freq3D = 28500000000;
% Find the weights
w = ones(getNumElements(Array), length(Frequency));
% Plot 3d graph
format = 'polar';
figure;
pattern(Array, Freq3D , 'PropagationSpeed', PropagationSpeed,...
'Type','directivity', 'CoordinateSystem', format,'weights', w(:,1));
% Find the weights
w = ones(getNumElements(Array), length(Frequency));
% Plot 2d elevation graph
format = 'polar';
cutAngle = 0;
figure;
pattern(Array, Frequency, cutAngle, -90:90, 'PropagationSpeed', PropagationSpeed,...
'Type', 'directivity', 'CoordinateSystem', format ,'weights', w);
format = 'rectangular';
cutAngle = 0;
figure;
pattern(Array, Frequency, cutAngle, -90:90, 'PropagationSpeed', PropagationSpeed,...
'Type', 'directivity', 'CoordinateSystem', format ,'weights', w);
u=pattern(Array, Freq3D , 'PropagationSpeed', PropagationSpeed,...
'Type','directivity', 'CoordinateSystem', format,'weights', w(:,1));
v=pattern(Array, Frequency, cutAngle, -90:90, 'PropagationSpeed', PropagationSpeed,...
'Type', 'directivity', 'CoordinateSystem', format ,'weights', w);
x=pattern(Array, Frequency, cutAngle, -90:90, 'PropagationSpeed', PropagationSpeed,...
'Type', 'directivity', 'CoordinateSystem', format ,'weights', w);
end
error:
Component: MATLAB Function | Category: Coder error
Code generation is not supported for viewArray.
Function 'MATLAB Function' (#54.1223.1301), line 40, column 1:
"viewArray(Array,'ShowNormal',false,..."
Launch diagnostic report.
Component: MATLAB Function | Category: Coder error
Code generation is not supported for pattern.
Function 'MATLAB Function' (#54.1470.1603), line 52, column 1:
"pattern(Array, Freq3D , 'PropagationSpeed', PropagationSpeed,..."
Launch diagnostic report.
Component: MATLAB Function | Category: Coder error
Code generation is not supported for pattern.
Function 'MATLAB Function' (#54.1608.1741), line 55, column 3:
"pattern(Array, Freq3D , 'PropagationSpeed', PropagationSpeed,..."
Launch diagnostic report.
Component: MATLAB Function | Category: Coder error
Code generation is not supported for pattern.
Function 'MATLAB Function' (#54.1881.2031), line 64, column 1:
"pattern(Array, Frequency, cutAngle, -90:90, 'PropagationSpeed', PropagationSpeed"
Launch diagnostic report.
Component: MATLAB Function | Category: Coder error
Code generation is not supported for pattern.
Function 'MATLAB Function' (#54.2035.2185), line 66, column 3:
"pattern(Array, Frequency, cutAngle, -90:90, 'PropagationSpeed', PropagationSpeed"
Launch diagnostic report.
Component: MATLAB Function | Category: Coder error
Code generation is not supported for pattern.
Function 'MATLAB Function' (#54.2233.2383), line 71, column 1:
"pattern(Array, Frequency, cutAngle, -90:90, 'PropagationSpeed', PropagationSpeed"
Launch diagnostic report.
Component: MATLAB Function | Category: Coder error
Code generation is not supported for pattern.
Function 'MATLAB Function' (#54.2387.2537), line 73, column 3:
"pattern(Array, Frequency, cutAngle, -90:90, 'PropagationSpeed', PropagationSpeed"
Launch diagnostic report.
Component: MATLAB Function | Category: Coder error
Errors occurred during parsing of MATLAB function 'cca48/MATLAB Function'
Component: MATLAB Function | Category: Coder error
Simulink cannot determine sizes and/or types of the outputs for block 'cca48/MATLAB Function' due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Component: MATLAB Function | Category: Coder error
Simulink cannot determine sizes and/or types of the outputs for block 'cca48/MATLAB Function' due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Component: Simulink | Category: Model error
Error occurred in 'cca48/MATLAB Function'.
Component: Simulink | Category: Model error
These are the errors I am getting.
I think CCA can be implemented using matlab function but I am not able to do, can you pls help me with this.
Thanking you!!!!

サインインしてコメントする。

### 採用された回答

Walter Roberson 2021 年 10 月 4 日
viewArray() and pattern() cannot have code generated for them.
Generally speaking, it is common for graphic functions such as pattern() to be considered to be small "applications" -- graphics with behaviour attached, rather than just plain plotting.
Code generation generally does not like to do plotting. To the extent that plotting is possible, you need coder.extrinsic and you need to have rapid acceleration turned off so that everything is interpreted as MATLAB code.
##### 7 件のコメント5 件の古いコメントを表示5 件の古いコメントを非表示
Walter Roberson 2021 年 10 月 4 日
I speculate that when you used coder.extrinsic() that Simulink is not able to recognize that you are invoking a method of an object, rather than a stand-alone function.
I do not know how to deal with the situation -- other than not calling pattern() or viewArray()
FARHA KHAN 2021 年 10 月 4 日
thank you for all the effort

サインインしてコメントする。

### カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

R2021a

### Community Treasure Hunt

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

Start Hunting!

Translated by