Index in position 2 is invalid. Array indices must be positive integers or logical values.
Show older comments
I=zeros(1,1);
f=zeros(1,1);
n=0;
m=0;
for ky=-6:0.1:6
for kx=-6:0.1:6
f(10*ky+61,10*kx+61)=exp(i*10^(-16)*(2.16*(n+m)*kx+1.245*(n-m)*ky))
I(10*ky+61,10*kx+61)=f(10*ky+61,10*kx+61).^2
end
end
contourf(-6:0.1:6,-6:0.1:6,I,'LineStyle','none');
The error says" Error in hw0928 (line 13) f(10*ky+61,10*kx+61)=exp(i*10^(-16)*(2.16*(n+m)*kx+1.245*(n-m)*ky))" What is worng?
Answers (5)
Walter Roberson
on 29 Sep 2019
0.1 is not exactly representable in finite binary floating point, just the same way that 1/7 is not exactly representable in finite decimal points, and when you increment a variable by 0.1 then even at the places that should logically be integers the result might be something that is not exactly an integer. When you multiply one of those numbers by 10, you might not get exactly an integer.
If you have a fractional floating point value that you intend to multiply by an integer to create an index, the best way to handle the situation is Don't Do That! . Instead, loop on integers and divide by the factor inside the loop to create the floating point value:
for ky10 = -60:1:60
ky = ky10 / 10;
for kx10 = -60:1:60
kx = kx10 / 10;
%code here
f(ky10 + 61), kx10 + 61) = ...
end
end
KALYAN ACHARJYA
on 29 Sep 2019
Edited: KALYAN ACHARJYA
on 29 Sep 2019
for ky=-6:0.1:6
for kx=-6:0.1:6
f(10*ky+61,10*kx+61)=exp(i*10^(-16)*(2.16*(n+m)*kx+1.245*(n-m)*ky))
I(10*ky+61,10*kx+61)=f(10*ky+61,10*kx+61).^2
end
end
Please choose the ky and kx, in such a way the
f(10*ky+61,10*kx+61)
%..^............^
I(10*ky+61,10*kx+61)
%..^..........^
"^" Always gives non zero positive result
Example In Matlab
f(1,1) allowed
f(-1,2) not allowed
I(0.4,-5) not allowed
I(3,6) allowed
Hence, initally for certain iteration your code is runs, but when f(num,num) or I(num,num) num becomes some negative, or decimal number or zero, it reflects error as Index in position 2 is invalid.
There are multiple answer for the same issue, please read the those answer, if you need more clarification. Still If you have any specific problem on this issue, let me know here.
Good Luck!
2 Comments
Zhiying Wang
on 29 Sep 2019
Walter Roberson
on 11 Mar 2020
It is nonzero and positive but not exactly an integer because 0.1 is not exactly representable in binary floating point.
the cyclist
on 29 Sep 2019
Here, I have re-written lots of your code:
n=0;
m=0;
ky_range = -6:0.1:6;
kx_range = -6:0.1:6;
nky = numel(ky_range);
nkx = numel(kx_range);
f = zeros(nky,nkx);
I = zeros(nky,nkx);
for yi = 1:nkx
ky = ky_range(yi);
for xi= 1:nky
kx = kx_range(xi);
f(yi,xi) = exp(i*10^(-16)*(2.16*(n+m)*kx+1.245*(n-m)*ky));
I(yi,xi) = f(yi,xi).^2;
end
end
[yy,xx] = ndgrid(ky_range,kx_range);
figure
contourf(yy,xx,I,'LineStyle','none');
The main issue with your code is that because of floating-point accuracy, your looping variable drifts away from being an exact integer, and therefore cannot be an index into an array.
Instead, I defined the ranges of your x and y in the same way you did, except now I count how many values there are, and loop over that count.
I also corrected your usage of contourf, which requires 2-D inputs for the x and y inputs. See the documentation for that function. Also, see the documentation for ndgrid, which I used to make the required grid.
Sadly, your function still gives an error. That is because m and n are constantly zero, and therefore I is constantly zero, so you cannot make a contour. I don't know how to fix that for you.
16 Comments
Zhiying Wang
on 29 Sep 2019
the cyclist
on 29 Sep 2019
The value of the expression
exp(i*10^(-16)*(2.16*(n+m)*kx+1.245*(n-m)*ky))
only changes a tiny amount for values of n and m around 0 to 2. It's near the floating point error of the expression itself.
If I remove that term of 10^(-16), your code runs to completion, giving the figure

So, again, I don't really know how to fix your code to give the correct output.
yakub sharif
on 13 Feb 2020
still shows as Index in position 1 is invalid. Array indices must be positive integers or logical values.
don't know what went wrong
for cur_x = 1:.5:10;
for cur_y = 1:.5:8;
nky = numel(cur_y);
nkx = numel(cur_x);
fprintf("(%f, %f), %f\n", nkx, nky)
the cyclist
on 13 Feb 2020
There is nothing specifically wrong with that little code snippet, although it is not really structured in the way I did mine, so I expect it is not doing what you expect.
One possible problem is if you accidentally named a variable numel, instead of using the numel function.
Can you post a piece of code that we can run, that shows the problem?
yakub sharif
on 14 Feb 2020
Hello, This one is my code. The thing is it can print the float points but can't display it in heatmap
If I use cur_x =1:a cur_y = 1:b,and don't use numel, then heatmap can display all the results but for floating points it can't display, that's the problem, could you please check, thanks. It can't display the grid values for every .5 interval.
hub_x = 8;
hub_y = 8;
wban_x = 5;
wban_y = 4;
wban_P_t = 15; %in dbm
wban_G_t = 1.7;
Relay_P_t = 15; %used 5 earlier
Relay_G_t = 1.7;
N=100;
a = 10;
b = 8;
Rect = [
0 0;
a 0;
a b;
0 b;
0 0];
wban_dist_relay_vec = zeros(size(Rect,1),1);
wban_pow_den_vec = zeros(size(Rect,1),1);
Relay_dist_hub_vec = zeros(size(Rect,1),1);
Relay_pow_den_vec = zeros(size(Rect,1),1);
total_dist_vec = zeros(N, 1);
total_pow_den_vec = zeros(N, 1);
surface_grid = zeros(b, a);
for cur_x = 1:.5:a;
for cur_y = 1:.5:b;
% nky = numel(cur_y);
% nkx = numel(cur_x);
wban_dist_hub = sqrt((hub_x - wban_x).^2 + (hub_y - wban_y).^2);
cur_dist_hub = sqrt(double((hub_x - cur_x).^2 + (hub_y - cur_y).^2));
for phi = -60 : 1 : 60;
%phi = 60;
phi3db = 93; % The angle causing 3-dB attenuation = 65 degs
Am = 30; % Maximum attenuation = 30 dB
% Horizontal radiation pattern
Aeh = -min( ( 12* ((phi/phi3db).^2)), Am ) ;
% Vertical radiation pattern
Aev = 0; % We are assuming "zero" attenuation on the vertical domain.
% Combined attenuation
A = -min ( (- (Aev+Aeh ) ), Am );
% Transmitter antenna gain
wban_GT1 = wban_G_t + A;
wban_dist_relay_vec = cur_dist_wban;
Pow_Den_wban = (db2pow(wban_GT1) * db2pow(wban_P_t)) / (4 * pi * wban_dist_hub^2.4);
wban_pow_den_vec = Pow_Den_wban;
% Relay to hub
Relay_dist_hub_vec = cur_dist_hub;
Pow_Den_Relay = (db2pow(Relay_G_t) * db2pow(Relay_P_t)) / (4 * pi * cur_dist_hub^2.4);
Relay_pow_den_vec = Pow_Den_Relay;
total_dist_vec = wban_dist_hub + cur_dist_hub;
total_pow_den_vec = Pow_Den_Relay + Pow_Den_wban;
surface_grid(numel(cur_y), numel(cur_x)) = total_pow_den_vec;
fprintf("(%d, %d), Pow_Den_wban:%f,Pow_Den_Relay:%f,total_pow_den_vec:%f \n", cur_x, cur_y, Pow_Den_wban, Pow_Den_Relay, total_pow_den_vec)
end
end
end
heatmapHandle = heatmap(surface_grid, 'ColorMap', jet(100))
heatmapHandle.YDisplayData = 1:.5:8
heatmapHandle.XDisplayData = 1:.5:10
heatmapHandle.YDisplayData = flipud(heatmapHandle.YDisplayData);
heatmapHandle.GridVisible = 'on';
caxis(heatmapHandle,[0 10]);
Walter Roberson
on 14 Feb 2020
Your cur_x and cyr_y are for loop variables and will be scalar. numel() of a scalar is always 1. So you are always writing to array location 1, 1
numel() has absolutely nothing to do with the concept of how many loop iterations you have done.
The iteration number for cur_x is round((cur_x-1)/0.5 + 1) which can written as round(cur_x*2)-1
yakub sharif
on 14 Feb 2020
Dear Roberson,
Sorry I didn't get it, If I want to plot the total_pow_den in the heatmap in every grid for .5 interval( in heatmap there should be value in 1 .15 2 2.5... in every grid) then what to do,cause heatmap isn't displaying or plotting values in floats
yakub sharif
on 14 Feb 2020
I think the floating coordinates are not diplaying values in heatmap only because it's recognizing the cur_y or cur_x as exponential (eg:1.500000e+00..) so if I can make them as one decimal(eg:1.5) only then heatmap can calculate the value to display otherwise it's showing blank in every decimal coordinate. Do you know If there is any way to make it upto one decimal or the heatmap to display floating coordinate?
the cyclist
on 14 Feb 2020
Edited: the cyclist
on 14 Feb 2020
Let me try to explain the basics of your problem with a simple example.
Define the vector v.
v = [2 2.5 3 3.5 4];
Now access the 4th element of that vector:
v(4)
ans =
3.5
Now, what happens if we try this ...
v(1.5)
Array indices must be positive integers or logical values
Why do we get that error? It is not because MATLAB cannot handle a floating point. It is because you are asking MATLAB to access the "1.5th element" in the vector. That makes no sense.
That is what your code is doing, and that is the problem.
Instead, you need to make a for loop over integers, and access the vector using those integer indices.
for i = 1:5
v(i) % Then use this value as you need it
end
yakub sharif
on 15 Feb 2020
Thank you Sir, I got your point, But If I want to display in heatmap the value of total_pow_den in (1.5,2.5) coordinate position, so it can be possible right? It can only plot in integer coordinates. I was trying to plot in every coordinate since It was able to print the total_pow_den values but couldn't plot in heatmap
yakub sharif
on 19 Feb 2020
Hello, Could you please help me on one more thing on plotting the total_pow_den with respect to wban_dist_hub and total_pow_den with respect to cur_dist_hub? thanks in advance
yakub sharif
on 11 Mar 2020
Hello Just one more question? Could you please let me know in my code where I used to vary the location of Relay positions in the line
for xidx = 1:numx
for yidx = 1:numy
relay_x = xvals(xidx);
relay_y = yvals(yidx);
row= row + 1;
if (relay_x == 0 || relay_y == 0)
continue;
end
can the positions of wban and hub be varied as well? I mean can the relay,wban and hub positions can be traversed altogether at the same time, If possible then how to modify that in the code, could you please help me? thanks
Walter Roberson
on 11 Mar 2020
You can index those with xidx yidx as required.
yakub sharif
on 11 Mar 2020
thank you. but if i index like this below
for xidx = 1:numx
for yidx = 1:numy
for iidx = 1:numx
for jidx = 1:numy
for midx = 1:numx
for nidx = 1:numy
wban_x = xvals(xidx);
wban_y = yvals(yidx);
hub_x = xvals(iidx);
hub_y = xvals(jidx);
relay_x = xvals(midx);
relay_y = xvals(nidx);
then what to enter in the surface grid brackets below?
surface_grid(yidx, xidx, phiidx) = total_pow_den_vec(row);
surface_grid2(yidx, xidx, phiidx) = SAR;
surface_grid3(yidx, xidx, phiidx) = R_Relay;
Walter Roberson
on 11 Mar 2020
Earlier you asked,
I mean can the relay,wban and hub positions can be traversed altogether at the same time
You would be most likely to ask that kind of question if you had arrays, relay, wban, hub that were the same sized as each other, and which gave corresponding data -- that the information for relay(J,K) corresponded to wban(J,K) for example, and you wanted to know how to index the three arrays together. Is that not what you are doing?
yakub sharif
on 14 Mar 2020
yes the size for each of them are same. The thing is first I traversed only the relay_x and relay_y. Now If i want to traverse each of them(wban_x,wban_y,relay_x,relay_y,hub_x,hub_y) Is the above part of code a good way to do that? because it's running but taking too long since it would try with all coordinates for wban,hub,relay like If i print it would start from (1,1),(1,1),(1,1), then, (1,1),(1,1),(1,2).....(16,15),(16,15),(16,15) almost 2hrs. So I was just curious Is it the way to index them like xidx,yidx,iidx,jidx,midx,nidx and then to plot should I use surface_grid(yidx, xidx, phiidx)? (Even If I change it to jidx,iidx,phi) it's still same because those are x,y coordinates.
Walter Roberson
on 14 Feb 2020
Warning: this produces one figure for each phi value !! Your code structure does not accumulate or average values over the different phi, so it follows that you need a different heatmap output for each phi value.
hub_x = 8;
hub_y = 8;
wban_x = 5;
wban_y = 4;
wban_P_t = 15; %in dbm
wban_G_t = 1.7;
Relay_P_t = 15; %used 5 earlier
Relay_G_t = 1.7;
N=100;
a = 10;
b = 8;
Rect = [
0 0;
a 0;
a b;
0 b;
0 0];
wban_dist_relay_vec = zeros(size(Rect,1),1);
wban_pow_den_vec = zeros(size(Rect,1),1);
Relay_dist_hub_vec = zeros(size(Rect,1),1);
Relay_pow_den_vec = zeros(size(Rect,1),1);
total_dist_vec = zeros(N, 1);
total_pow_den_vec = zeros(N, 1);
xvals = 1:.5:a;
numx = length(xvals);
yvals = 1:.5:b;
numy = length(yvals);
phivals = -60:1:60;
numphi = length(phivals);
surface_grid = zeros(numy, numx, numphi);
for xidx = 1:numx
cur_x = xvals(xidx);
for yidx = 1:numy
cur_y = yvals(yidx);
wban_dist_hub = sqrt((hub_x - wban_x).^2 + (hub_y - wban_y).^2);
cur_dist_hub = sqrt(double((hub_x - cur_x).^2 + (hub_y - cur_y).^2));
for phiidx = 1:numphi
phi = phivals(phiidx);
phi3db = 93; % The angle causing 3-dB attenuation = 65 degs
Am = 30; % Maximum attenuation = 30 dB
% Horizontal radiation pattern
Aeh = -min( ( 12* ((phi/phi3db).^2)), Am ) ;
% Vertical radiation pattern
Aev = 0; % We are assuming "zero" attenuation on the vertical domain.
% Combined attenuation
A = -min ( (- (Aev+Aeh ) ), Am );
% Transmitter antenna gain
wban_GT1 = wban_G_t + A;
wban_dist_relay_vec = cur_dist_wban;
Pow_Den_wban = (db2pow(wban_GT1) * db2pow(wban_P_t)) / (4 * pi * wban_dist_hub^2.4);
wban_pow_den_vec = Pow_Den_wban;
% Relay to hub
Relay_dist_hub_vec = cur_dist_hub;
Pow_Den_Relay = (db2pow(Relay_G_t) * db2pow(Relay_P_t)) / (4 * pi * cur_dist_hub^2.4);
Relay_pow_den_vec = Pow_Den_Relay;
total_dist_vec = wban_dist_hub + cur_dist_hub;
total_pow_den_vec = Pow_Den_Relay + Pow_Den_wban;
surface_grid(yidx, xidx, phiidx) = total_pow_den_vec;
fprintf("(%f, %f, %f), Pow_Den_wban:%f, Pow_Den_Relay:%f, total_pow_den_vec:%f\n", cur_x, cur_y, phi, Pow_Den_wban, Pow_Den_Relay, total_pow_den_vec);
end
end
end
for phiidx = 1 : numphi
phi = phivals(phiidx);
figure();
heatmapHandle = heatmap(surface_grid(:,:,phiidx), 'ColorMap', jet(100))
heatmapHandle.YDisplayData = 1:.5:8
heatmapHandle.XDisplayData = 1:.5:10
heatmapHandle.YDisplayData = flipud(heatmapHandle.YDisplayData);
heatmapHandle.GridVisible = 'on';
caxis(heatmapHandle,[0 10]);
title( sprintf('phi = %f', phi))
end
11 Comments
yakub sharif
on 15 Feb 2020
Thanks a lot Roberson, You helped a lot. But I don't wan't so many figures for each phi. I only want total_pow_den as maximum for whichever phi it was acheived(for instance If in (3,2) for phi=23 total_pow_den is maximum then It would plot that one in (3,2), again in (4,2) coordinate If total_pow_den is maximum for phi=56, then It would plot that maximum, so heatmap would be in one figure showing only the maximum total_pow_den, If you could help on that.
And the main problem is I wanted to display in heatmap every coordinate as total_pow_den. Here in the Heatmap only the integer coordinates are showing values not the floating coordinates (eg: (2,3) coordinate is displaying value not (2.5, 3.5)) If that can be possible for heatmap to show.
yakub sharif
on 17 Feb 2020
Hi could you please help me on that?
Walter Roberson
on 17 Feb 2020
values_to_plot = max(surface_grid,[],3);
heatmapHandle = heatmap(values_to_plot, 'ColorMap', jet(100))
heatmapHandle.YDisplayData = 1:.5:8
heatmapHandle.XDisplayData = 1:.5:10
heatmapHandle.YDisplayData = flipud(heatmapHandle.YDisplayData);
heatmapHandle.GridVisible = 'on';
caxis(heatmapHandle,[0 10]);
yakub sharif
on 17 Feb 2020
Hi, this doesn't plot the largest value in one window, For instance at (10,7) coordinate 0.617753 is the maximum with phi =0 bt it's displaying the last value of .56 with phi = 60 (since it's the last phi, displayed only this one as .56 for (10,7) in heatmap you can see)
yakub sharif
on 19 Feb 2020
Hello, Could you please help me on one more thing on plotting the total_pow_den with respect to wban_dist_hub and total_pow_den with respect to cur_dist_hub? thanks in advance
yakub sharif
on 24 Feb 2020
Hello, could you please help me to insert the angle phivals like below in the loop instead of -60:1:60
phivals = (atan((relay_y-wban_y)/(relay_x-wban_x))-atan((hub_y-wban_y)/(hub_x-wban_x)))*180/pi;
Here the prob is heatmap couldn't plot according to phivals since the phivals in your code was initiated as -60:1:60 earlier but if I want to insert there the formula above it searches for relay_y or relay_x which is initiated later on in the loop, so it can't find.
Please help me to syntax the formula inline correctly, thanks
Walter Roberson
on 25 Feb 2020
phivals = (atan((relay_y-wban_y)./(relay_x-wban_x))-atan((hub_y-wban_y)./(hub_x-wban_x))).*180./pi;
yakub sharif
on 25 Feb 2020
Thanks. No I meant where to write the code inline. If I write it in the loop (since it will search for relay_x/y) the phivals is already mentioned outside the loop that would be a problem everytime to update. So could you please tell me in the code you wrote above that where to set this line, thanks in advance.
yakub sharif
on 2 Mar 2020
Hello, Could you please help me on this? I am reducing the Relay_P_t_temp everytime, as a result the (total_pow_den_vec(row) is getting reduced, So If I want to plot the (total_pow_den_vec(row) for each reduced Relay_P_t_temp in heatmap do you know how to do that, the code is below, thanks.
% clear all;
% close all;
clc;
a = 16; % a = length
b = 15; % b = width
N = 240; % N = no. of Relays
hub_x = 15;
hub_y = 15;
X = [1 8];
Y = [1 8];
Relay_P_t = 15; %used 15 earlier
Relay_G_t = 8; %used 1.7 earlier
% when using relay stations
wban_P_t = 15; %in dbm
wban_G_t = 1.7; %in dbi
% Relay_P_t_temp = 15; %used 5 earlier
% wban_P_t_temp = 1.7; %in dbm
BW = 4e6;
wban_x = 1;
wban_y = 1;
%SNR calculation
T = 295; % Room temperature = 295 K
NF_UE = 19.2; % Noise figure = 19.2 dB
N_UE = -198.5992 + 10*log10(T) + 10*log10(BW) + NF_UE;
epsn = 39.2; % Permittivity: fccid.io/XRAFB505/RF-Exposure Info
delta = 113e-3; % Skin penetration depth = 113mm @2.4 GHz: ncbi.nlm.nih.gov
rho = 1.80; % Skin conductivity: fccid.io/XRAFB505/RF-Exposure Info
phi3db = 93; % The angle causing 3-dB attenuation = 93 degs
Am = 30; % Maximum attenuation = 30 dB
fc = 2.4;
distMax = 1;
distIncr = 5e-3;
dist0 = 1e-4 : distIncr : distMax;
ISD = .2;
one_cell_prpg = dist0(1:find(dist0 < ISD/2, 1, 'last' ));
two_cell_prpg = [one_cell_prpg ISD/2 fliplr(one_cell_prpg(2:end))];
num_two_cell_prpgs = ceil(size(dist0,2) / size(two_cell_prpg,2));
dd = 1 : N;
wban_dist_relay_vec = zeros(N,1);
wban_pow_den_vec = zeros(N,1);
Relay_dist_hub_vec = zeros(N,1);
Relay_pow_den_vec = zeros(N,1);
total_dist_vec = zeros(N, 1);
total_pow_den_vec = zeros(N, 1);
rand_coordinate = rand(N,2);
xvals = 1:a;
numx = length(xvals);
yvals = 1:b;
numy = length(yvals);
surface_grid = zeros(numy, numx);
surface_grid2 = zeros(numy, numx);
surface_grid3 = zeros(numy, numx);
row = 0;
for xidx = 1:numx
for yidx = 1:numy
relay_x = xvals(xidx);
relay_y = yvals(yidx);
row= row + 1;
if (relay_x == 0 || relay_y == 0)
continue;
end
phivals = (atan((relay_y-wban_y)./(relay_x-wban_x))-atan((hub_y-wban_y)./(hub_x-wban_x))).*180./pi;
numphi = length(phivals);
wban_dist_hub = sqrt((hub_x - wban_x).^2 + (hub_y - wban_y).^2); % wban to hub distance
relay_dist_hub = sqrt(((hub_x - relay_x).^2 + (hub_y - relay_y).^2)); % hub to realy distance
if (relay_dist_hub == 0)
continue;
end
% wban to Relay
wban_dist_relay_vec(row) = wban_dist_hub;
% Relay to hub
Relay_dist_hub_vec(row) = relay_dist_hub;
% wban to Hub
total_dist_vec(row) = wban_dist_hub + relay_dist_hub;
% Path loss
PL_LoS_wban = 24*log10(wban_dist_hub)+ 24*log10(fc)+38.93;
PL_LoS_relay = 24*log10(relay_dist_hub)+ 24*log10(fc)+38.93;
% Relay to hub power density vector
Pow_Den_Relayy = (Relay_G_t + Relay_P_t-30)-10*log10(4*pi*(relay_dist_hub*.1)^2.4);
Pow_Den_Relay = db2pow(Pow_Den_Relayy);
Relay_pow_den_vec(row) = Pow_Den_Relay;
Pow_Den_wban_relayless = db2pow((wban_G_t + wban_P_t-30)- 10*log10(4 * pi * (wban_dist_hub*.1)^2.4));
Pr_direct = (wban_P_t + wban_G_t - PL_LoS_wban);
avg_SNR_direct = Pr_direct - N_UE;
fprintf("avg_SNR_direct: %.3f\n", avg_SNR_direct)
R = BW*log2(1 + db2pow(avg_SNR_direct))/1e9; % power received from wban to relay
Relay_P_t_temp = Relay_P_t;
% Calculating antenna Gain
for phiidx = 1:numphi
phi = phivals(phiidx);
fprintf("phi: %.3f\n", phi);
% Horizontal radiation pattern
Aeh = -min( ( 12* ((phi/phi3db).^2)), Am ) ;
% Vertical radiation pattern
Aev = 0; % We are assuming "zero" attenuation on the vertical domain.
% Combined attenuation
A = -min ( (- (Aev+Aeh ) ), Am );
while 1
% Transmitter antenna gain
wban_GT1 = wban_G_t + A;
% Final Received Power
Pr_wban = (wban_P_t_temp + wban_GT1 - PL_LoS_wban); %in dB all; power received from wban to relay
% wban to relay power density vector
Pow_Den_wbann = (wban_GT1 + wban_P_t_temp-30)- 10*log10(4 * pi * (wban_dist_hub*.1)^2.4);
Pow_Den_wban = db2pow(Pow_Den_wbann);
wban_pow_den_vec(row) = Pow_Den_wban;
total_pow_den_vec(row) = Pow_Den_Relay + Pow_Den_wban;
% power received from relay to hub
Pr_relay = (Relay_P_t_temp + Relay_G_t - PL_LoS_relay); %in dB all;
% avg_SNR = Pr_wban+Pr_relay -N_UE;
avg_SNR = Pr_relay - N_UE;
fprintf("avg_SNR: %.3f\n", avg_SNR)
% Average data rate; from wban to relay + relay to hub
R_Relay = BW*log2(1 + db2pow(avg_SNR))/1e9;
if R_Relay <= R
break;
end
Relay_P_t_temp = Relay_P_t_temp - 0.1;
end
fprintf("Data Rate: %.3f, %.3f, %.3f\n", R, R_Relay);
fprintf("phiidx: %d, Relay_P_t_temp: %0.3f", phiidx, Relay_P_t_temp);
fprintf("\n");
angles_Wban = 210*pi./180;
angle_width = 4*pi/6;
angle_begins = angles_Wban - angle_width/2;
theta1 = angle_begins(1) + rand(1,N) * angle_width;
angle_rotation_new = abs( angles_Wban - theta1 );
for pp = 1 : size(phi,2)
m = abs( cos(phi*pi/180) / sqrt(1 - epsn^(-1)*(sin(phi*pi/180))^2) );
rTE = ( cos(phi*pi/180) - sqrt(epsn - (sin(phi(pp)*pi/180)).^2) ) / ( cos(phi*pi/180) + sqrt(epsn - (sin(phi*pi/180)).^2) );
rTM = ( epsn*cos(phi(pp)*pi/180) - sqrt(epsn - (sin(phi(pp)*pi/180)).^2) ) / ( epsn*cos(phi(pp)*pi/180) + sqrt(epsn - (sin(phi(pp)*pi/180)).^2) );
TTE = 1 - (abs(rTE))^2;
TTM = 1 - (abs(rTM))^2;
% Specific Absorption Rate (SAR)
SAR = (2 *(total_pow_den_vec(row)) * TTE * m ) / (delta * rho);
end % End of for pp
% fprintf("(%d, %d), phi: %d, avg_SNR: %d, R_Relay: %d, Pr_wban: %d, Pr_relay: %d, m: %f, TTE: %f, SAR: %f, Pow_Den_wban: %f, Pow_Den_Relay: %f, total_pow_den_vec(row): %f\n", relay_x, relay_y, phi, avg_SNR, R_Relay, Pr_wban, Pr_relay, m, TTE, SAR, Pow_Den_wban, Pow_Den_Relay, total_pow_den_vec(row));
surface_grid(yidx, xidx, phiidx) = total_pow_den_vec(row);
surface_grid2(yidx, xidx, phiidx) = SAR;
surface_grid3(yidx, xidx, phiidx) = R_Relay;
if row == 1
break;
end
end
end
end
% end
% end
% fprintf("%d, %d, %d\n", relay_x, relay_y, row);
% figure;
% plot(wban_dist_hub,Pow_Den_Relay);
% figure;
% plot(wban_dist_relay_vec,wban_pow_den_vec);
% sorted = zeros(N,2); sorted(:,1) = wban_dist_relay_vec; sorted(:,2) =
% wban_pow_den_vec; after_sorting = sortrows(sorted, 2);
% unique_after_sorting = unique(after_sorting,'rows');
sorted = zeros(N,2);
sorted(:,1) = Relay_dist_hub_vec;
sorted(:,2) = Relay_pow_den_vec;
after_sorting = sortrows(sorted, 2);
unique_after_sorting = unique(after_sorting,'rows');
% figure;
% plot(wban_dist_relay_vec(row),avg_SNR, 'r', 'LineWidth', 2);
% hold on
%plot for SAR
figure;
%plot(wban_dist_relay_vec(row),SAR_64(dd,pp), 'g','LineWidth',2);
xlabel('distance (m)');
ylabel('SAR');
% figure;
max_range = 90;
plot_x = unique_after_sorting(81:max_range,1);
plot_y = unique_after_sorting(81:max_range,2);
% plot(plot_x, plot_y, '*', 'LineWidth', 2);
plot(plot_x, plot_y);
grid on
xlabel('total Distance ')
ylabel('Power Density (W/m^2)');
% figure;
% %plot(wban_dist_relay_vec(row),avg_SNR, 'r', 'LineWidth', 2);
% hold on
% %plot for SAR
% figure;
% %plot(wban_dist_relay_vec(row),SAR_64(iter,dd,pp), 'g','LineWidth',2);
% xlabel('distance (m)');
% ylabel('SAR');
% figure;
% semilogy(dist0,avgSAR,'LineWidth',2);
% grid on
% xlabel('Distance between human head and wearable device(m)')
% ylabel('SAR (W/kg)');
% set(gca,'FontSize',12)
% figure;
%plot(unique_after_sorting(2:size(unique_after_sorting,1),1),unique_after_sorting(2:size(unique_after_sorting,1),2));
% grid on
% xlabel('Wearable to Relay Distance (m) ')
% ylabel('Wearable to Relay Power Density (W/m^2)');
% figure;
% xvar=linspace(.5,1);
% yvar=linspace(.5,1);
% imagesc(xvar, yvar, surface_grid);
%set (gca, 'ydir', 'reverse')
%fliplr('ydir')
% set(gca, 'Ydir','normal')
% %colormap('hot');
% colorbar;
%figure;
%imagesc(surface_grid2);
colorbar;
%figure;
%imagesc(surface_grid1);
%set ( gca, 'ydir', 'reverse' )
%fliplr('ydir')
%set(gca, 'Ydir','normal')
%colormap('hot');
colorbar;
% figure;
% xvar=linspace(4,10);
% yvar=linspace(4,10);
% figure;
% values_to_plot = max(surface_grid,[],3);
% heatmapHandle = heatmap(values_to_plot, 'ColorMap', jet(100));
% heatmapHandle.XLabel = 'Power Density';
% heatmapHandle.YDisplayData = flipud(heatmapHandle.YDisplayData);
% heatmapHandle.GridVisible = 'on';
% caxis(heatmapHandle,[0 10]);
figure;
values_to_plot = max(surface_grid,[],3);
heatmapHandle = heatmap(values_to_plot, 'ColorMap', jet(100));
heatmapHandle.XLabel = 'Power Density';
heatmapHandle.YDisplayData = flipud(heatmapHandle.YDisplayData);
heatmapHandle.GridVisible = 'on';
caxis(heatmapHandle,[0 10]);
colorbar;
figure;
% xvalues = 1:10
% yvalues = 1:8
% clf
% xvar=linspace(1,.5,5);
% yvar=linspace(1,.5,5);
values_to_plott = max(surface_grid2,[],3);
heatmapHandle = heatmap(values_to_plott, 'ColorMap', jet(100));
heatmapHandle.XLabel = 'SAR';
heatmapHandle.YDisplayData = flipud(heatmapHandle.YDisplayData);
heatmapHandle.GridVisible = 'on';
caxis(heatmapHandle,[0 4]);
figure;
values_to_plottt = max(surface_grid3,[],3);
heatmapHandle = heatmap(values_to_plottt, 'ColorMap', jet(100));
heatmapHandle.XLabel = 'Data Rate';
heatmapHandle.YDisplayData = flipud(heatmapHandle.YDisplayData);
heatmapHandle.GridVisible = 'on';
caxis(heatmapHandle,[0.2 .4]);
Walter Roberson
on 2 Mar 2020
Unrecognized function or variable 'wban_P_t_temp'.
Error in relay_reduction (line 127)
Pr_wban = (wban_P_t_temp + wban_GT1 - PL_LoS_wban); %in dB all; power received from wban to relay
yakub sharif
on 3 Mar 2020
Sorry my bad, the wban_P_t_temp should be replaced by wban_P_t only. this is the code below, what I wanted is for every relay_P_t temp there would be on heatmap showing the total_pow_den_vec(row) and SAR.
% clear all;
% close all;
clc;
a = 16; % a = length
b = 15; % b = width
N = 240; % N = no. of Relays
hub_x = 15;
hub_y = 15;
X = [1 8];
Y = [1 8];
Relay_P_t = 15; %used 15 earlier
Relay_G_t = 8; %used 1.7 earlier
% when using relay stations
wban_P_t = 15; %in dbm
wban_G_t = 1.7; %in dbi
% Relay_P_t_temp = 15; %used 5 earlier
% wban_P_t_temp = 1.7; %in dbm
BW = 4e6;
wban_x = 1;
wban_y = 1;
%SNR calculation
T = 295; % Room temperature = 295 K
NF_UE = 19.2; % Noise figure = 19.2 dB
N_UE = -198.5992 + 10*log10(T) + 10*log10(BW) + NF_UE;
epsn = 39.2; % Permittivity: fccid.io/XRAFB505/RF-Exposure Info
delta = 113e-3; % Skin penetration depth = 113mm @2.4 GHz: ncbi.nlm.nih.gov
rho = 1.80; % Skin conductivity: fccid.io/XRAFB505/RF-Exposure Info
% epsn = 50.97; % for whole body also in https://itis.swiss/virtual-population/tissue-properties/database/tissue-frequency-chart/ Permittivity: fccid.io/XRAFB505/RF-Exposure Info
% delta = 22.6e-3; % Skin penetration depth = 113mm @2.4 GHz: ncbi.nlm.nih.gov
% rho = 1.97; % Skin conductivity: fccid.io/XRAFB505/RF-Exposure Info
phi3db = 93; % The angle causing 3-dB attenuation = 93 degs
Am = 30; % Maximum attenuation = 30 dB
fc = 2.4;
distMax = 1;
distIncr = 5e-3;
dist0 = 1e-4 : distIncr : distMax;
ISD = .2;
one_cell_prpg = dist0(1:find(dist0 < ISD/2, 1, 'last' ));
two_cell_prpg = [one_cell_prpg ISD/2 fliplr(one_cell_prpg(2:end))];
num_two_cell_prpgs = ceil(size(dist0,2) / size(two_cell_prpg,2));
dd = 1 : N;
wban_dist_relay_vec = zeros(N,1);
wban_pow_den_vec = zeros(N,1);
Relay_dist_hub_vec = zeros(N,1);
Relay_pow_den_vec = zeros(N,1);
total_dist_vec = zeros(N, 1);
total_pow_den_vec = zeros(N, 1);
rand_coordinate = rand(N,2);
xvals = 1:a;
numx = length(xvals);
yvals = 1:b;
numy = length(yvals);
surface_grid = zeros(numy, numx);
surface_grid2 = zeros(numy, numx);
surface_grid3 = zeros(numy, numx);
row = 0;
for xidx = 1:numx
for yidx = 1:numy
relay_x = xvals(xidx);
relay_y = yvals(yidx);
row= row + 1;
if (relay_x == 0 || relay_y == 0)
continue;
end
phivals = (atan((relay_y-wban_y)./(relay_x-wban_x))-atan((hub_y-wban_y)./(hub_x-wban_x))).*180./pi;
numphi = length(phivals);
wban_dist_hub = sqrt((hub_x - wban_x).^2 + (hub_y - wban_y).^2); % wban to hub distance
relay_dist_hub = sqrt(((hub_x - relay_x).^2 + (hub_y - relay_y).^2)); % hub to realy distance
if (relay_dist_hub == 0)
continue;
end
% wban to Relay
wban_dist_relay_vec(row) = wban_dist_hub;
% Relay to hub
Relay_dist_hub_vec(row) = relay_dist_hub;
% wban to Hub
total_dist_vec(row) = wban_dist_hub + relay_dist_hub;
% Path loss
PL_LoS_wban = 24*log10(wban_dist_hub)+ 24*log10(fc)+38.93;
PL_LoS_relay = 24*log10(relay_dist_hub)+ 24*log10(fc)+38.93;
% % Relay to hub power density vector
% Pow_Den_Relayy = (Relay_G_t + Relay_P_t-30)-10*log10(4*pi*(relay_dist_hub*.1)^2.4);
% Pow_Den_Relay = db2pow(Pow_Den_Relayy);
% Relay_pow_den_vec(row) = Pow_Den_Relay;
Pow_Den_wban_relayless = db2pow((wban_G_t + wban_P_t-30)- 10*log10(4 * pi * (wban_dist_hub*.1)^2.4));
Pr_direct = (wban_P_t + wban_G_t - PL_LoS_wban);
avg_SNR_direct = Pr_direct - N_UE;
% fprintf("avg_SNR_direct: %.3f\n", avg_SNR_direct)
R = BW*log2(1 + db2pow(avg_SNR_direct))/1e9; % power received from wban to relay
Relay_P_t_temp = Relay_P_t;
% Calculating antenna Gain
for phiidx = 1:numphi
phi = phivals(phiidx);
% fprintf("phi: %.3f\n", phi);
% Horizontal radiation pattern
Aeh = -min( ( 12* ((phi/phi3db).^2)), Am ) ;
% Vertical radiation pattern
Aev = 0; % We are assuming "zero" attenuation on the vertical domain.
% Combined attenuation
A = -min ( (- (Aev+Aeh ) ), Am );
while 1
% Transmitter antenna gain
wban_GT1 = wban_G_t + A;
% Final Received Power
Pr_wban = (wban_P_t + wban_GT1 - PL_LoS_wban); %in dB all; power received from wban to relay
% wban to relay power density vector
Pow_Den_wbann = (wban_GT1 + wban_P_t-30)- 10*log10(4 * pi * (wban_dist_hub*.1)^2.4);
Pow_Den_wban = db2pow(Pow_Den_wbann);
wban_pow_den_vec(row) = Pow_Den_wban;
total_pow_den_vec(row) = Pow_Den_Relay + Pow_Den_wban;
% Relay to hub power density vector
Pow_Den_Relayy = (Relay_G_t + Relay_P_t-30)-10*log10(4*pi*(relay_dist_hub*.1)^2.4);
Pow_Den_Relay = db2pow(Pow_Den_Relayy);
Relay_pow_den_vec(row) = Pow_Den_Relay;
% power received from relay to hub
Pr_relay = (Relay_P_t_temp + Relay_G_t - PL_LoS_relay); %in dB all;
% avg_SNR = Pr_wban+Pr_relay -N_UE;
avg_SNR = Pr_relay - N_UE;
% fprintf("avg_SNR: %.3f\n", avg_SNR)
% Average data rate; from wban to relay + relay to hub
R_Relay = BW*log2(1 + db2pow(avg_SNR))/1e9;
if R_Relay <= R
break;
end
Relay_P_t_temp = Relay_P_t_temp - 0.1;
end
fprintf("(%d, %d),Data Rate: %.3f, %.3f, %.3f\n", relay_x, relay_y, R, R_Relay);
fprintf("phi: %d, Relay_P_t_temp: %0.3f", phi, Relay_P_t_temp);
fprintf("\n");
angles_Wban = 210*pi./180;
angle_width = 4*pi/6;
angle_begins = angles_Wban - angle_width/2;
theta1 = angle_begins(1) + rand(1,N) * angle_width;
angle_rotation_new = abs( angles_Wban - theta1 );
for pp = 1 : size(phi,2)
m = abs( cos(phi*pi/180) / sqrt(1 - epsn^(-1)*(sin(phi*pi/180))^2) );
rTE = ( cos(phi*pi/180) - sqrt(epsn - (sin(phi(pp)*pi/180)).^2) ) / ( cos(phi*pi/180) + sqrt(epsn - (sin(phi*pi/180)).^2) );
rTM = ( epsn*cos(phi(pp)*pi/180) - sqrt(epsn - (sin(phi(pp)*pi/180)).^2) ) / ( epsn*cos(phi(pp)*pi/180) + sqrt(epsn - (sin(phi(pp)*pi/180)).^2) );
TTE = 1 - (abs(rTE))^2;
TTM = 1 - (abs(rTM))^2;
% Specific Absorption Rate (SAR)
SAR = (2 *(total_pow_den_vec(row)) * TTE * m ) / (delta * rho);
end % End of for pp
% fprintf("(%d, %d), phi: %d, avg_SNR: %d, R_Relay: %d, Pr_wban: %d, Pr_relay: %d, m: %f, TTE: %f, SAR: %f, Pow_Den_wban: %f, Pow_Den_Relay: %f, total_pow_den_vec(row): %f\n", relay_x, relay_y, phi, avg_SNR, R_Relay, Pr_wban, Pr_relay, m, TTE, SAR, Pow_Den_wban, Pow_Den_Relay, total_pow_den_vec(row));
% fprintf("(%d, %d), phi: %d, Relay_P_t: %d, avg_SNR: %d, R_Relay: %d, SAR: %f, Pow_Den_wban: %f, Pow_Den_Relay: %f, total_pow_den_vec(row): %f\n", relay_x, relay_y, phi, Relay_P_t_temp, avg_SNR, R_Relay, SAR, Pow_Den_wban, Pow_Den_Relay, total_pow_den_vec(row));
surface_grid(yidx, xidx, phiidx) = total_pow_den_vec(row);
surface_grid2(yidx, xidx, phiidx) = SAR;
surface_grid3(yidx, xidx, phiidx) = R_Relay;
if row == 1
break;
end
end
end
end
% end
% end
% fprintf("%d, %d, %d\n", relay_x, relay_y, row);
% figure;
% plot(wban_dist_hub,Pow_Den_Relay);
% figure;
% plot(wban_dist_relay_vec,wban_pow_den_vec);
% sorted = zeros(N,2); sorted(:,1) = wban_dist_relay_vec; sorted(:,2) =
% wban_pow_den_vec; after_sorting = sortrows(sorted, 2);
% unique_after_sorting = unique(after_sorting,'rows');
sorted = zeros(N,2);
sorted(:,1) = Relay_dist_hub_vec;
sorted(:,2) = Relay_pow_den_vec;
after_sorting = sortrows(sorted, 2);
unique_after_sorting = unique(after_sorting,'rows');
% figure;
% plot(wban_dist_relay_vec(row),avg_SNR, 'r', 'LineWidth', 2);
% hold on
%plot for SAR
figure;
%plot(wban_dist_relay_vec(row),SAR_64(dd,pp), 'g','LineWidth',2);
xlabel('distance (m)');
ylabel('SAR');
% figure;
max_range = 90;
plot_x = unique_after_sorting(81:max_range,1);
plot_y = unique_after_sorting(81:max_range,2);
% plot(plot_x, plot_y, '*', 'LineWidth', 2);
plot(plot_x, plot_y);
grid on
xlabel('total Distance ')
ylabel('Power Density (W/m^2)');
% figure;
% %plot(wban_dist_relay_vec(row),avg_SNR, 'r', 'LineWidth', 2);
% hold on
% %plot for SAR
% figure;
% %plot(wban_dist_relay_vec(row),SAR_64(iter,dd,pp), 'g','LineWidth',2);
% xlabel('distance (m)');
% ylabel('SAR');
% figure;
% semilogy(dist0,avgSAR,'LineWidth',2);
% grid on
% xlabel('Distance between human head and wearable device(m)')
% ylabel('SAR (W/kg)');
% set(gca,'FontSize',12)
% figure;
%plot(unique_after_sorting(2:size(unique_after_sorting,1),1),unique_after_sorting(2:size(unique_after_sorting,1),2));
% grid on
% xlabel('Wearable to Relay Distance (m) ')
% ylabel('Wearable to Relay Power Density (W/m^2)');
% figure;
% xvar=linspace(.5,1);
% yvar=linspace(.5,1);
% imagesc(xvar, yvar, surface_grid);
%set (gca, 'ydir', 'reverse')
%fliplr('ydir')
% set(gca, 'Ydir','normal')
% %colormap('hot');
% colorbar;
%figure;
%imagesc(surface_grid2);
colorbar;
%figure;
%imagesc(surface_grid1);
%set ( gca, 'ydir', 'reverse' )
%fliplr('ydir')
%set(gca, 'Ydir','normal')
%colormap('hot');
colorbar;
% figure;
% xvar=linspace(4,10);
% yvar=linspace(4,10);
% figure;
% values_to_plot = max(surface_grid,[],3);
% heatmapHandle = heatmap(values_to_plot, 'ColorMap', jet(100));
% heatmapHandle.XLabel = 'Power Density';
% heatmapHandle.YDisplayData = flipud(heatmapHandle.YDisplayData);
% heatmapHandle.GridVisible = 'on';
% caxis(heatmapHandle,[0 10]);
figure;
values_to_plot = max(surface_grid,[],3);
heatmapHandle = heatmap(values_to_plot, 'ColorMap', jet(100));
heatmapHandle.XLabel = 'Power Density';
heatmapHandle.YDisplayData = flipud(heatmapHandle.YDisplayData);
heatmapHandle.GridVisible = 'on';
caxis(heatmapHandle,[0 10]);
colorbar;
figure;
% xvalues = 1:10
% yvalues = 1:8
% clf
% xvar=linspace(1,.5,5);
% yvar=linspace(1,.5,5);
values_to_plott = max(surface_grid2,[],3);
heatmapHandle = heatmap(values_to_plott, 'ColorMap', jet(100));
heatmapHandle.XLabel = 'SAR';
heatmapHandle.YDisplayData = flipud(heatmapHandle.YDisplayData);
heatmapHandle.GridVisible = 'on';
caxis(heatmapHandle,[0 4]);
figure;
values_to_plottt = max(surface_grid3,[],3);
heatmapHandle = heatmap(values_to_plottt, 'ColorMap', jet(100));
heatmapHandle.XLabel = 'Data Rate';
heatmapHandle.YDisplayData = flipud(heatmapHandle.YDisplayData);
heatmapHandle.GridVisible = 'on';
caxis(heatmapHandle,[0.2 .4]);
% y = [1 1.5 2 2.5 3 3.5 4.5 6.5 7.5 8.5 9.5 10]
% set(gca, 'YTick', 1:length(y), 'YTickLabel', y)
% set(gca, 'Ydir','normal')
% fig = figure;
% response = fig2plotly(fig, 'filename', 'matlab-basic-heatmap');
% plotly_url = response.url;
% figure;
% plot(sort(Relay_dist_hub_vec),sort( Relay_pow_den_vec));
% figure;
% plot(sort(total_dist_vec), sort(total_pow_den_vec));
%
% % set(legend, 'Location', 'Best')
% % drawnow
%
% a1 = 0;
% b1 = a;
% x = (b1-a1).*rand(N,1)+a1;
% a2 = 0;
% b2 = b;
% y = (b2-a2).*rand(N,1)+a2;
% %x = rand(0,a);
% %y = rand(0,b);
% plot(Rect(:,1),Rect(:,2),'r');
% hold on
% plot(x,y,'*b')
% % cdf = duniformcdf(L,W,x);
% % stairs(x,cdf)
%
% total_pow_den_vec(row)1 = makedist('Uniform');
% x = 0:.1:a;
% total_pow_den_vec(row)f1 = total_pow_den_vec(row)f(total_pow_den_vec(row)1,x);
% figure;
% stairs(x,total_pow_den_vec(row)f1,'r','LineWidth',2);
% total_pow_den_vec(row)1 = makedist('Uniform');
% x = 0:.01:a;
% cdf1 = cdf(total_pow_den_vec(row)1,x);
% figure;
% plot(x,cdf1,'r','LineWidth',2);
% hold on;
% figure;
% x = -140:10:140;
% total_pow_den_vec(row)2 = makedist('Uniform','lower',-2,'upper',2);
% total_pow_den_vec(row)f2 = total_pow_den_vec(row)f(total_pow_den_vec(row)2,x);
% stairs(x,total_pow_den_vec(row)f2,'k:','LineWidth',2);
% %% Creation of a cdf
%compute_one_minus_cdf( reshape(rate_final, 1,size(rate_final,1)*size(rate_final,2)*size(rate_final,3)*size(rate_final,4)*size(rate_final,5)*size(rate_final,6)) )
%compute_one_minus_cdf( reshape(total_pow_den_vec, 1,size(total_pow_den_vec,1)*size(total_pow_den_vec,2)*size(total_pow_den_vec,3)*size(total_pow_den_vec,4)) )
%compute_one_minus_cdf( reshape(total_pow_den_vec(row), 1,size(Si_in_pow,1)*size(Si_in_pow,2)*size(Si_in_pow,3)*size(Si_in_pow,4)) )
%compute_one_minus_cdf( reshape(SAR, 1,size(SAR,1)*size(SAR,2)*size(SAR,3)*size(SAR,4)) )
% close all;
yakub sharif
on 11 Mar 2020
0 votes
Hello Just one more question? Could you please let me know in my code where I used to vary the location of Relay positions in the line
for xidx = 1:numx
for yidx = 1:numy
relay_x = xvals(xidx);
relay_y = yvals(yidx);
row= row + 1;
if (relay_x == 0 || relay_y == 0)
continue;
end
can the positions of wban and hub be varied as well? I mean can the relay,wban and hub positions can be traversed altogether at the same time, If possible then how to modify that in the code, could you please help me? thanks
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!