Tag Archives: matlab
High BER with comm.RayTracingChannel when MaxNumReflections is Set to 0
Hi,
I’m working on writing a code to evaluate BER using comm.RayTracingChannel. I’m referencing the example "Indoor MIMO-OFDM Communication Link Using Ray Tracing". In this example, when I set MaxNumReflections to 0, allowing only the direct path, the BER comes out to be close to 50%.
I don’t understand why this happens. Realistically, in a chamber LOS environment, measuring BER should result in only a direct path and a very low BER. Why does the example produce such a high BER?
Any insights would be greatly appreciated.
Thanks.Hi,
I’m working on writing a code to evaluate BER using comm.RayTracingChannel. I’m referencing the example "Indoor MIMO-OFDM Communication Link Using Ray Tracing". In this example, when I set MaxNumReflections to 0, allowing only the direct path, the BER comes out to be close to 50%.
I don’t understand why this happens. Realistically, in a chamber LOS environment, measuring BER should result in only a direct path and a very low BER. Why does the example produce such a high BER?
Any insights would be greatly appreciated.
Thanks. Hi,
I’m working on writing a code to evaluate BER using comm.RayTracingChannel. I’m referencing the example "Indoor MIMO-OFDM Communication Link Using Ray Tracing". In this example, when I set MaxNumReflections to 0, allowing only the direct path, the BER comes out to be close to 50%.
I don’t understand why this happens. Realistically, in a chamber LOS environment, measuring BER should result in only a direct path and a very low BER. Why does the example produce such a high BER?
Any insights would be greatly appreciated.
Thanks. # ray tracing, #communication #mimo #ofdm MATLAB Answers — New Questions
Problem connecting reliably to Thingspeak over Ethernet
I have been trying to set up a Feather MO plus Ethernet wing to connect to my Thingspeak account. The project will report temperature, humidity, atmospheric pressure and calculate dew point using a BMP280 sensor board every 60 seconds. I’ve written my own code, I’ve also tried other peoples code, I’ve updated all the libraries. The programs are short and simple and they will run for a while (several hours), then fail. When reporting via the IDE they report -304 or -302 errors first, then -301. When the code runs directly connected to the internet it runs for longer but then fails after a few days.
In my latest attempt I took a Mathworks code example directly from Github and only made minor changes to suit the Thingspeak format that I was sending the data to (see below). This code doesn’t use the BME280 or any other code at all, it is just the Mathworks code. The results were the same, it runs for a few hours then reports –304 (Timeout) a few times then recovers, then -302 (Unexpected fail) and then finally, repeated -301 (Connect fail). I suppose I could work around the issue with a Watch Dog Timer but that shouldn’t be necessary.
I now suspect that the problem may be with my router/modem settings (Arris DG3270A) – an area I know very little about. Can anyone suggest what the problem may be and how to fix it? Thank you.
Michael
/*
WriteMultipleFields
Description: Writes values to fields 1,2,3 and 4 in a single ThingSpeak update every 20 seconds.
Hardware: Arduino Ethernet
!!! IMPORTANT – Modify the secrets.h file for this project with your network connection and ThingSpeak channel details. !!!
Note:
– Requires the Ethernet library
ThingSpeak ( https://www.thingspeak.com ) is an analytic IoT platform service that allows you to aggregate, visualize, and
analyze live data streams in the cloud. Visit https://www.thingspeak.com to sign up for a free account and create a channel.
Documentation for the ThingSpeak Communication Library for Arduino is in the README.md folder where the library was installed.
See https://www.mathworks.com/help/thingspeak/index.html for the full ThingSpeak documentation.
For licensing information, see the accompanying license file.
Copyright 2020, The MathWorks, Inc.
*/
#include <Ethernet.h>
#include "Ethernetsecrets.h"
#include "ThingSpeak.h" // always include thingspeak header file after other header files and custom macros
byte mac[] = SECRET_MAC;
// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 0, 177);
IPAddress myDns(192, 168, 0, 1); //changed to 4 from 1
EthernetClient client;
unsigned long myChannelNumber = SECRET_CH_ID;
const char * myWriteAPIKey = SECRET_WRITE_APIKEY;
// Initialize our values
int number1 = 56;
int number2 = random(20,30);
int number3 = random(900,1000);
int number4 = random(0,20);
void setup() {
Ethernet.init(10); // 10 is for most Arduino Ethernet hardware
Serial.begin(115200); //Initialize serial
// start the Ethernet connection:
Serial.println("Initialize Ethernet with DHCP:");
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// Check for Ethernet hardware present
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println("Ethernet shield was not found. Sorry, can’t run without hardware. :(");
while (true) {
delay(1); // do nothing, no point running without Ethernet hardware
}
}
if (Ethernet.linkStatus() == LinkOFF) {
Serial.println("Ethernet cable is not connected.");
}
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, ip, myDns);
} else {
Serial.print(" DHCP assigned IP ");
Serial.println(Ethernet.localIP());
}
// give the Ethernet shield a second to initialize:
delay(1000);
ThingSpeak.begin(client); // Initialize ThingSpeak
}
void loop() {
// set the fields with the values
ThingSpeak.setField(1, number1);
ThingSpeak.setField(2, number2);
ThingSpeak.setField(3, number3);
ThingSpeak.setField(4, number4);
// write to the ThingSpeak channel
int x = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
if(x == 200){
Serial.println("Channel update successful.");
}
else{
Serial.println("Problem updating channel. HTTP error code " + String(x));
}
number1 = 56;
number2 = random(20,30);
number3 = random(900,1000);
number4 = random(0,20);
delay(60000); // Wait 60 seconds to update the channel again
}I have been trying to set up a Feather MO plus Ethernet wing to connect to my Thingspeak account. The project will report temperature, humidity, atmospheric pressure and calculate dew point using a BMP280 sensor board every 60 seconds. I’ve written my own code, I’ve also tried other peoples code, I’ve updated all the libraries. The programs are short and simple and they will run for a while (several hours), then fail. When reporting via the IDE they report -304 or -302 errors first, then -301. When the code runs directly connected to the internet it runs for longer but then fails after a few days.
In my latest attempt I took a Mathworks code example directly from Github and only made minor changes to suit the Thingspeak format that I was sending the data to (see below). This code doesn’t use the BME280 or any other code at all, it is just the Mathworks code. The results were the same, it runs for a few hours then reports –304 (Timeout) a few times then recovers, then -302 (Unexpected fail) and then finally, repeated -301 (Connect fail). I suppose I could work around the issue with a Watch Dog Timer but that shouldn’t be necessary.
I now suspect that the problem may be with my router/modem settings (Arris DG3270A) – an area I know very little about. Can anyone suggest what the problem may be and how to fix it? Thank you.
Michael
/*
WriteMultipleFields
Description: Writes values to fields 1,2,3 and 4 in a single ThingSpeak update every 20 seconds.
Hardware: Arduino Ethernet
!!! IMPORTANT – Modify the secrets.h file for this project with your network connection and ThingSpeak channel details. !!!
Note:
– Requires the Ethernet library
ThingSpeak ( https://www.thingspeak.com ) is an analytic IoT platform service that allows you to aggregate, visualize, and
analyze live data streams in the cloud. Visit https://www.thingspeak.com to sign up for a free account and create a channel.
Documentation for the ThingSpeak Communication Library for Arduino is in the README.md folder where the library was installed.
See https://www.mathworks.com/help/thingspeak/index.html for the full ThingSpeak documentation.
For licensing information, see the accompanying license file.
Copyright 2020, The MathWorks, Inc.
*/
#include <Ethernet.h>
#include "Ethernetsecrets.h"
#include "ThingSpeak.h" // always include thingspeak header file after other header files and custom macros
byte mac[] = SECRET_MAC;
// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 0, 177);
IPAddress myDns(192, 168, 0, 1); //changed to 4 from 1
EthernetClient client;
unsigned long myChannelNumber = SECRET_CH_ID;
const char * myWriteAPIKey = SECRET_WRITE_APIKEY;
// Initialize our values
int number1 = 56;
int number2 = random(20,30);
int number3 = random(900,1000);
int number4 = random(0,20);
void setup() {
Ethernet.init(10); // 10 is for most Arduino Ethernet hardware
Serial.begin(115200); //Initialize serial
// start the Ethernet connection:
Serial.println("Initialize Ethernet with DHCP:");
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// Check for Ethernet hardware present
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println("Ethernet shield was not found. Sorry, can’t run without hardware. :(");
while (true) {
delay(1); // do nothing, no point running without Ethernet hardware
}
}
if (Ethernet.linkStatus() == LinkOFF) {
Serial.println("Ethernet cable is not connected.");
}
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, ip, myDns);
} else {
Serial.print(" DHCP assigned IP ");
Serial.println(Ethernet.localIP());
}
// give the Ethernet shield a second to initialize:
delay(1000);
ThingSpeak.begin(client); // Initialize ThingSpeak
}
void loop() {
// set the fields with the values
ThingSpeak.setField(1, number1);
ThingSpeak.setField(2, number2);
ThingSpeak.setField(3, number3);
ThingSpeak.setField(4, number4);
// write to the ThingSpeak channel
int x = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
if(x == 200){
Serial.println("Channel update successful.");
}
else{
Serial.println("Problem updating channel. HTTP error code " + String(x));
}
number1 = 56;
number2 = random(20,30);
number3 = random(900,1000);
number4 = random(0,20);
delay(60000); // Wait 60 seconds to update the channel again
} I have been trying to set up a Feather MO plus Ethernet wing to connect to my Thingspeak account. The project will report temperature, humidity, atmospheric pressure and calculate dew point using a BMP280 sensor board every 60 seconds. I’ve written my own code, I’ve also tried other peoples code, I’ve updated all the libraries. The programs are short and simple and they will run for a while (several hours), then fail. When reporting via the IDE they report -304 or -302 errors first, then -301. When the code runs directly connected to the internet it runs for longer but then fails after a few days.
In my latest attempt I took a Mathworks code example directly from Github and only made minor changes to suit the Thingspeak format that I was sending the data to (see below). This code doesn’t use the BME280 or any other code at all, it is just the Mathworks code. The results were the same, it runs for a few hours then reports –304 (Timeout) a few times then recovers, then -302 (Unexpected fail) and then finally, repeated -301 (Connect fail). I suppose I could work around the issue with a Watch Dog Timer but that shouldn’t be necessary.
I now suspect that the problem may be with my router/modem settings (Arris DG3270A) – an area I know very little about. Can anyone suggest what the problem may be and how to fix it? Thank you.
Michael
/*
WriteMultipleFields
Description: Writes values to fields 1,2,3 and 4 in a single ThingSpeak update every 20 seconds.
Hardware: Arduino Ethernet
!!! IMPORTANT – Modify the secrets.h file for this project with your network connection and ThingSpeak channel details. !!!
Note:
– Requires the Ethernet library
ThingSpeak ( https://www.thingspeak.com ) is an analytic IoT platform service that allows you to aggregate, visualize, and
analyze live data streams in the cloud. Visit https://www.thingspeak.com to sign up for a free account and create a channel.
Documentation for the ThingSpeak Communication Library for Arduino is in the README.md folder where the library was installed.
See https://www.mathworks.com/help/thingspeak/index.html for the full ThingSpeak documentation.
For licensing information, see the accompanying license file.
Copyright 2020, The MathWorks, Inc.
*/
#include <Ethernet.h>
#include "Ethernetsecrets.h"
#include "ThingSpeak.h" // always include thingspeak header file after other header files and custom macros
byte mac[] = SECRET_MAC;
// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 0, 177);
IPAddress myDns(192, 168, 0, 1); //changed to 4 from 1
EthernetClient client;
unsigned long myChannelNumber = SECRET_CH_ID;
const char * myWriteAPIKey = SECRET_WRITE_APIKEY;
// Initialize our values
int number1 = 56;
int number2 = random(20,30);
int number3 = random(900,1000);
int number4 = random(0,20);
void setup() {
Ethernet.init(10); // 10 is for most Arduino Ethernet hardware
Serial.begin(115200); //Initialize serial
// start the Ethernet connection:
Serial.println("Initialize Ethernet with DHCP:");
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// Check for Ethernet hardware present
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println("Ethernet shield was not found. Sorry, can’t run without hardware. :(");
while (true) {
delay(1); // do nothing, no point running without Ethernet hardware
}
}
if (Ethernet.linkStatus() == LinkOFF) {
Serial.println("Ethernet cable is not connected.");
}
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, ip, myDns);
} else {
Serial.print(" DHCP assigned IP ");
Serial.println(Ethernet.localIP());
}
// give the Ethernet shield a second to initialize:
delay(1000);
ThingSpeak.begin(client); // Initialize ThingSpeak
}
void loop() {
// set the fields with the values
ThingSpeak.setField(1, number1);
ThingSpeak.setField(2, number2);
ThingSpeak.setField(3, number3);
ThingSpeak.setField(4, number4);
// write to the ThingSpeak channel
int x = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
if(x == 200){
Serial.println("Channel update successful.");
}
else{
Serial.println("Problem updating channel. HTTP error code " + String(x));
}
number1 = 56;
number2 = random(20,30);
number3 = random(900,1000);
number4 = random(0,20);
delay(60000); // Wait 60 seconds to update the channel again
} thingspeak, feather, ethernet wing MATLAB Answers — New Questions
dual solution for skin friction and nusselt number and sheerword number using bvp4c solver: mathematical equations and the code is given in description.
Artical:Unsteady boundary-layer flow and heat transfer of a nanofluid over a permeable stretching/shrinking sheet
here are the mathematical equations:
f^”’+A(ff^”-f^’2 )+f^’+η/2 f^”=0
1/Pr θ^”+(Af+η/2) θ^’+Nbθ^’ φ^’+Nt(θ^’ )^2=0
φ^”+Le(Af+η/2) φ^’+Nt/Nb θ^”=0
boundary conditions:
f(0)=s, f^’ (0)=λ, θ(0)=1,φ(0)=1
f^’ (η)→0,θ(η)→0,φ (η)→0 as η→inf
the code is :
Ibrardual()
function Ibrardual
clc
clear all
Nt=0.5; Nb=0.5; Le=2; Pr=1; alpha=1.5; s=1; A=3;
%% solution in structure form
%First solution
sol = bvpinit(linspace(0,6,10), [0 0 0 0 0 0 0]);
sol1 = bvp4c(@bvpexam2, @bcexam2, sol);
x1 = sol1.x;
y1 = sol1.y;
% Second solution
opts = bvpset(‘stats’,’off’,’RelTol’,1e-10);
sol = bvpinit(linspace(0,5,10), [-1 0 0 0 0 0 0]);
sol2 = bvp4c(@bvpexam2, @bcexam2_dual, sol,opts);
x2 = sol2.x;
y2 = sol2.y;
% Plot both solutions
plot(x1,y1(3,:),’-‘); hold on
plot(x2,y2(3,:),’–‘);
xlabel(‘eta’)
ylabel(‘f`(eta)’)
result1 = A^(-1/2)*y1(3,1)
result2 = A^(-1/2)*y2(3,1)
%%residual of bcs
function res = bcexam2(y0, yinf)
res= [y0(1)-s; y0(2)-alpha; y0(4)-1; y0(6)-1; yinf(2); yinf(4);yinf(6)];
end
function res = bcexam2_dual(y0, yinf)
res= [y0(1)-s; y0(2)-alpha; y0(4)-1; y0(6)-1; yinf(2); yinf(4);yinf(6)];
end
%% first order odes
function ysol = bvpexam2(x,y)
yy1 = -(A*y(1)*y(3)-A*(y(2))^2)-y(2)-(x/2)*y(3);
yy2 = -Pr*(A*y(1)*y(5)+(x/2)*y(5)+Nb*y(5)*y(7)+Nt*(y(5))^2);
yy3 = (-Le*(A*(y(1)*y(7)+(x/2)*y(7)))-(Nt/Nb)*( -Pr*(A*y(1)*y(5)+Nb*y(5)*y(7)+Nt*(y(5))^2)));
ysol = [y(2); y(3); yy1;y(5);yy2;y(7);yy3];
end
endArtical:Unsteady boundary-layer flow and heat transfer of a nanofluid over a permeable stretching/shrinking sheet
here are the mathematical equations:
f^”’+A(ff^”-f^’2 )+f^’+η/2 f^”=0
1/Pr θ^”+(Af+η/2) θ^’+Nbθ^’ φ^’+Nt(θ^’ )^2=0
φ^”+Le(Af+η/2) φ^’+Nt/Nb θ^”=0
boundary conditions:
f(0)=s, f^’ (0)=λ, θ(0)=1,φ(0)=1
f^’ (η)→0,θ(η)→0,φ (η)→0 as η→inf
the code is :
Ibrardual()
function Ibrardual
clc
clear all
Nt=0.5; Nb=0.5; Le=2; Pr=1; alpha=1.5; s=1; A=3;
%% solution in structure form
%First solution
sol = bvpinit(linspace(0,6,10), [0 0 0 0 0 0 0]);
sol1 = bvp4c(@bvpexam2, @bcexam2, sol);
x1 = sol1.x;
y1 = sol1.y;
% Second solution
opts = bvpset(‘stats’,’off’,’RelTol’,1e-10);
sol = bvpinit(linspace(0,5,10), [-1 0 0 0 0 0 0]);
sol2 = bvp4c(@bvpexam2, @bcexam2_dual, sol,opts);
x2 = sol2.x;
y2 = sol2.y;
% Plot both solutions
plot(x1,y1(3,:),’-‘); hold on
plot(x2,y2(3,:),’–‘);
xlabel(‘eta’)
ylabel(‘f`(eta)’)
result1 = A^(-1/2)*y1(3,1)
result2 = A^(-1/2)*y2(3,1)
%%residual of bcs
function res = bcexam2(y0, yinf)
res= [y0(1)-s; y0(2)-alpha; y0(4)-1; y0(6)-1; yinf(2); yinf(4);yinf(6)];
end
function res = bcexam2_dual(y0, yinf)
res= [y0(1)-s; y0(2)-alpha; y0(4)-1; y0(6)-1; yinf(2); yinf(4);yinf(6)];
end
%% first order odes
function ysol = bvpexam2(x,y)
yy1 = -(A*y(1)*y(3)-A*(y(2))^2)-y(2)-(x/2)*y(3);
yy2 = -Pr*(A*y(1)*y(5)+(x/2)*y(5)+Nb*y(5)*y(7)+Nt*(y(5))^2);
yy3 = (-Le*(A*(y(1)*y(7)+(x/2)*y(7)))-(Nt/Nb)*( -Pr*(A*y(1)*y(5)+Nb*y(5)*y(7)+Nt*(y(5))^2)));
ysol = [y(2); y(3); yy1;y(5);yy2;y(7);yy3];
end
end Artical:Unsteady boundary-layer flow and heat transfer of a nanofluid over a permeable stretching/shrinking sheet
here are the mathematical equations:
f^”’+A(ff^”-f^’2 )+f^’+η/2 f^”=0
1/Pr θ^”+(Af+η/2) θ^’+Nbθ^’ φ^’+Nt(θ^’ )^2=0
φ^”+Le(Af+η/2) φ^’+Nt/Nb θ^”=0
boundary conditions:
f(0)=s, f^’ (0)=λ, θ(0)=1,φ(0)=1
f^’ (η)→0,θ(η)→0,φ (η)→0 as η→inf
the code is :
Ibrardual()
function Ibrardual
clc
clear all
Nt=0.5; Nb=0.5; Le=2; Pr=1; alpha=1.5; s=1; A=3;
%% solution in structure form
%First solution
sol = bvpinit(linspace(0,6,10), [0 0 0 0 0 0 0]);
sol1 = bvp4c(@bvpexam2, @bcexam2, sol);
x1 = sol1.x;
y1 = sol1.y;
% Second solution
opts = bvpset(‘stats’,’off’,’RelTol’,1e-10);
sol = bvpinit(linspace(0,5,10), [-1 0 0 0 0 0 0]);
sol2 = bvp4c(@bvpexam2, @bcexam2_dual, sol,opts);
x2 = sol2.x;
y2 = sol2.y;
% Plot both solutions
plot(x1,y1(3,:),’-‘); hold on
plot(x2,y2(3,:),’–‘);
xlabel(‘eta’)
ylabel(‘f`(eta)’)
result1 = A^(-1/2)*y1(3,1)
result2 = A^(-1/2)*y2(3,1)
%%residual of bcs
function res = bcexam2(y0, yinf)
res= [y0(1)-s; y0(2)-alpha; y0(4)-1; y0(6)-1; yinf(2); yinf(4);yinf(6)];
end
function res = bcexam2_dual(y0, yinf)
res= [y0(1)-s; y0(2)-alpha; y0(4)-1; y0(6)-1; yinf(2); yinf(4);yinf(6)];
end
%% first order odes
function ysol = bvpexam2(x,y)
yy1 = -(A*y(1)*y(3)-A*(y(2))^2)-y(2)-(x/2)*y(3);
yy2 = -Pr*(A*y(1)*y(5)+(x/2)*y(5)+Nb*y(5)*y(7)+Nt*(y(5))^2);
yy3 = (-Le*(A*(y(1)*y(7)+(x/2)*y(7)))-(Nt/Nb)*( -Pr*(A*y(1)*y(5)+Nb*y(5)*y(7)+Nt*(y(5))^2)));
ysol = [y(2); y(3); yy1;y(5);yy2;y(7);yy3];
end
end matlab MATLAB Answers — New Questions
Prevent Matlab from updating the legend when saving a figure
I have a figure with a tiled layout and some plots which – because they are partly related – I don’t want to give them all their own legend entry, but rather summarise several plots with one entry. I do this by subsequently changing the legend entries to display several line types, like in this example:
leg = legend([plot1, plot2], {‘Plot1’, ‘Plot2’});
drawnow();
% Update legend
hLegendEntryTop = leg.EntryContainer.NodeChildren(end); % top row of legend
iconSet = hLegendEntryTop.Icon.Transform.Children.Children; % array of icons
% Move primary line up
iconSet(1).VertexData(2,1) = 0.65;
iconSet(1).VertexData(2,2) = 0.65;
% Create a new line
iconSet(2) = copy(iconSet(1)); % copy the object
iconSet(2) = iconSet(1).Parent; % set the parent, adding to the legend’s icon draw set
% Move primary line down
iconSet(2).VertexData(2,1) = 0.35;
iconSet(2).VertexData(2,2) = 0.35;
iconSet(2).LineStyle = ‘dashed’;
…… % Do the same with other plot lines
saveas(gcf,’figure’,’epsc’)
Interestingly, it works when exporting as PNG, but not when exporting as eps or pdf (vector graphics). The image is then updated and all additional lines inserted disappear again. I have absolutely no idea how I can prevent Matlab from updating the legend again when saving.I have a figure with a tiled layout and some plots which – because they are partly related – I don’t want to give them all their own legend entry, but rather summarise several plots with one entry. I do this by subsequently changing the legend entries to display several line types, like in this example:
leg = legend([plot1, plot2], {‘Plot1’, ‘Plot2’});
drawnow();
% Update legend
hLegendEntryTop = leg.EntryContainer.NodeChildren(end); % top row of legend
iconSet = hLegendEntryTop.Icon.Transform.Children.Children; % array of icons
% Move primary line up
iconSet(1).VertexData(2,1) = 0.65;
iconSet(1).VertexData(2,2) = 0.65;
% Create a new line
iconSet(2) = copy(iconSet(1)); % copy the object
iconSet(2) = iconSet(1).Parent; % set the parent, adding to the legend’s icon draw set
% Move primary line down
iconSet(2).VertexData(2,1) = 0.35;
iconSet(2).VertexData(2,2) = 0.35;
iconSet(2).LineStyle = ‘dashed’;
…… % Do the same with other plot lines
saveas(gcf,’figure’,’epsc’)
Interestingly, it works when exporting as PNG, but not when exporting as eps or pdf (vector graphics). The image is then updated and all additional lines inserted disappear again. I have absolutely no idea how I can prevent Matlab from updating the legend again when saving. I have a figure with a tiled layout and some plots which – because they are partly related – I don’t want to give them all their own legend entry, but rather summarise several plots with one entry. I do this by subsequently changing the legend entries to display several line types, like in this example:
leg = legend([plot1, plot2], {‘Plot1’, ‘Plot2’});
drawnow();
% Update legend
hLegendEntryTop = leg.EntryContainer.NodeChildren(end); % top row of legend
iconSet = hLegendEntryTop.Icon.Transform.Children.Children; % array of icons
% Move primary line up
iconSet(1).VertexData(2,1) = 0.65;
iconSet(1).VertexData(2,2) = 0.65;
% Create a new line
iconSet(2) = copy(iconSet(1)); % copy the object
iconSet(2) = iconSet(1).Parent; % set the parent, adding to the legend’s icon draw set
% Move primary line down
iconSet(2).VertexData(2,1) = 0.35;
iconSet(2).VertexData(2,2) = 0.35;
iconSet(2).LineStyle = ‘dashed’;
…… % Do the same with other plot lines
saveas(gcf,’figure’,’epsc’)
Interestingly, it works when exporting as PNG, but not when exporting as eps or pdf (vector graphics). The image is then updated and all additional lines inserted disappear again. I have absolutely no idea how I can prevent Matlab from updating the legend again when saving. save, legend MATLAB Answers — New Questions
What is the autocorrelation of the Gaussian random noise sequence N = 20
What is the autocorrelation of the Gaussian random noise sequence N = 20What is the autocorrelation of the Gaussian random noise sequence N = 20 What is the autocorrelation of the Gaussian random noise sequence N = 20 dsp MATLAB Answers — New Questions
The Output structure of a code is showing different outputs in command window and workspace
When working on a program, after executing it and checking output in MATLAB command window and in output from workspace is giving different outputs. Which is correct output here and what is this happening?
Command window output:
Workspace output:When working on a program, after executing it and checking output in MATLAB command window and in output from workspace is giving different outputs. Which is correct output here and what is this happening?
Command window output:
Workspace output: When working on a program, after executing it and checking output in MATLAB command window and in output from workspace is giving different outputs. Which is correct output here and what is this happening?
Command window output:
Workspace output: output matlab MATLAB Answers — New Questions
I need to connect physical modelling connection port to the output of a switch with 2 input. How can I establish this?
Post Content Post Content multiple source connection MATLAB Answers — New Questions
How to retrieve datas from multiples GUIs into a function ?
Hello everyone !
I have several GUI windows to collect parameters and I want to use them in functions.
The problem is, I store datas from edit text boxes into arrays like that :
typex=getappdata(hObject,’typex’);
typex(end+1)=str2double(handles.typex(1).String);
handles.typex(1).String=sprintf(‘block %d’,numel(typex)+1);
disp(typex)
setappdata(hObject,’typex’,typex);
assignin(‘base’,’typex’,typex);
Then, in a callback I use them in the same GUI:
xw=getappdata(handles.xw(1),’xw’);
xe=getappdata(handles.xe(1),’xe’);
nx=getappdata(handles.nx(1),’nx’);
typex=getappdata(handles.typex(1),’typex’);
%Choix du programme de rafinement a executer
if(typex==1)
n=length(nx);
for i=1:n
xwt=xw(i);
xet=xe(i);
nxt=nx(i);
create_block_uniform_X(xwt, xet, nxt)
end
That does works.
But in an other function, I use that to retrieve the datas:
X=getappdata(0,’X’)
Y=getappdata(0,’Y’)
Z=getappdata(0,’Z’)
nx=getappdata(0,’nx’)
xw=getappdata(0,’xw’)
xe=getappdata(0,’xe’)
ny=getappdata(0,’ny’)
yw=getappdata(0,’yw’)
ye=getappdata(0,’ye’)
nz=getappdata(0,’nz’)
zw=getappdata(0,’zw’)
ze=getappdata(0,’ze’)
The thing is that for X,Y,Z it does retrieve the datas (X, Y, Z are the outputs arguments from the previous fonction ‘create_block_uniform’) but that return empty arrays for the others… I don’t understand
Z =
Columns 1 through 13
0 1.1111 2.2222 3.3333 4.4444 5.5556 6.6667 7.7778 8.8889 10.0000 0 0 0
Columns 14 through 18
0 0 0 0 0
nx =
[]
xw =
[]
xe =
[]
Could someone help me ?
Thanks !Hello everyone !
I have several GUI windows to collect parameters and I want to use them in functions.
The problem is, I store datas from edit text boxes into arrays like that :
typex=getappdata(hObject,’typex’);
typex(end+1)=str2double(handles.typex(1).String);
handles.typex(1).String=sprintf(‘block %d’,numel(typex)+1);
disp(typex)
setappdata(hObject,’typex’,typex);
assignin(‘base’,’typex’,typex);
Then, in a callback I use them in the same GUI:
xw=getappdata(handles.xw(1),’xw’);
xe=getappdata(handles.xe(1),’xe’);
nx=getappdata(handles.nx(1),’nx’);
typex=getappdata(handles.typex(1),’typex’);
%Choix du programme de rafinement a executer
if(typex==1)
n=length(nx);
for i=1:n
xwt=xw(i);
xet=xe(i);
nxt=nx(i);
create_block_uniform_X(xwt, xet, nxt)
end
That does works.
But in an other function, I use that to retrieve the datas:
X=getappdata(0,’X’)
Y=getappdata(0,’Y’)
Z=getappdata(0,’Z’)
nx=getappdata(0,’nx’)
xw=getappdata(0,’xw’)
xe=getappdata(0,’xe’)
ny=getappdata(0,’ny’)
yw=getappdata(0,’yw’)
ye=getappdata(0,’ye’)
nz=getappdata(0,’nz’)
zw=getappdata(0,’zw’)
ze=getappdata(0,’ze’)
The thing is that for X,Y,Z it does retrieve the datas (X, Y, Z are the outputs arguments from the previous fonction ‘create_block_uniform’) but that return empty arrays for the others… I don’t understand
Z =
Columns 1 through 13
0 1.1111 2.2222 3.3333 4.4444 5.5556 6.6667 7.7778 8.8889 10.0000 0 0 0
Columns 14 through 18
0 0 0 0 0
nx =
[]
xw =
[]
xe =
[]
Could someone help me ?
Thanks ! Hello everyone !
I have several GUI windows to collect parameters and I want to use them in functions.
The problem is, I store datas from edit text boxes into arrays like that :
typex=getappdata(hObject,’typex’);
typex(end+1)=str2double(handles.typex(1).String);
handles.typex(1).String=sprintf(‘block %d’,numel(typex)+1);
disp(typex)
setappdata(hObject,’typex’,typex);
assignin(‘base’,’typex’,typex);
Then, in a callback I use them in the same GUI:
xw=getappdata(handles.xw(1),’xw’);
xe=getappdata(handles.xe(1),’xe’);
nx=getappdata(handles.nx(1),’nx’);
typex=getappdata(handles.typex(1),’typex’);
%Choix du programme de rafinement a executer
if(typex==1)
n=length(nx);
for i=1:n
xwt=xw(i);
xet=xe(i);
nxt=nx(i);
create_block_uniform_X(xwt, xet, nxt)
end
That does works.
But in an other function, I use that to retrieve the datas:
X=getappdata(0,’X’)
Y=getappdata(0,’Y’)
Z=getappdata(0,’Z’)
nx=getappdata(0,’nx’)
xw=getappdata(0,’xw’)
xe=getappdata(0,’xe’)
ny=getappdata(0,’ny’)
yw=getappdata(0,’yw’)
ye=getappdata(0,’ye’)
nz=getappdata(0,’nz’)
zw=getappdata(0,’zw’)
ze=getappdata(0,’ze’)
The thing is that for X,Y,Z it does retrieve the datas (X, Y, Z are the outputs arguments from the previous fonction ‘create_block_uniform’) but that return empty arrays for the others… I don’t understand
Z =
Columns 1 through 13
0 1.1111 2.2222 3.3333 4.4444 5.5556 6.6667 7.7778 8.8889 10.0000 0 0 0
Columns 14 through 18
0 0 0 0 0
nx =
[]
xw =
[]
xe =
[]
Could someone help me ?
Thanks ! store data MATLAB Answers — New Questions
Login problems with Matlab 2024a
I keep receiving the message "Unable to save login information. You are currently signed in but you will be prompted to sign in again the next time that you start this application." everytime I start the Matlab application.
I tried to follow all the steps I could find, such as reinstaling the Mathworks Service Host, eliminating the files at ‘%APPDATA%MathWorkscredentials’, ‘%APPDATA%RoamingMathWorksMATLAB’, reinstaling the Matlab 2024a. I don’t know what else to do in order to fix this problem.
Can you help me?I keep receiving the message "Unable to save login information. You are currently signed in but you will be prompted to sign in again the next time that you start this application." everytime I start the Matlab application.
I tried to follow all the steps I could find, such as reinstaling the Mathworks Service Host, eliminating the files at ‘%APPDATA%MathWorkscredentials’, ‘%APPDATA%RoamingMathWorksMATLAB’, reinstaling the Matlab 2024a. I don’t know what else to do in order to fix this problem.
Can you help me? I keep receiving the message "Unable to save login information. You are currently signed in but you will be prompted to sign in again the next time that you start this application." everytime I start the Matlab application.
I tried to follow all the steps I could find, such as reinstaling the Mathworks Service Host, eliminating the files at ‘%APPDATA%MathWorkscredentials’, ‘%APPDATA%RoamingMathWorksMATLAB’, reinstaling the Matlab 2024a. I don’t know what else to do in order to fix this problem.
Can you help me? login, r2024a, credentials MATLAB Answers — New Questions
Error in data size using CIC filter in Simulink R2020b: The number of input rows must be a multiple of the decimation factor
I am trying a simple Simulink model of an NCO generating a sin and cos which I then use in their own respective CIC decimator to generate quad and real output signals.
In the two product blocks (X) I get an error "The number of input rows must be a multiple of the decimation factor". I tried adding the convert blocks and specifying output type fixdt(1,20,18), but that didn’t help. The NCO is generating the proper sin and cos with amplitude +/-1 and frequency 13.5MHz with a 256Mhz sample rate.
What is the trick to getting the CIC to work? I looked at a similar Matlab Example for a GSM dds and it worked, but there was nothing special done (that I could see) to make the CIC input data types correct. Please help, I’ve spent a day chasing this problem :(I am trying a simple Simulink model of an NCO generating a sin and cos which I then use in their own respective CIC decimator to generate quad and real output signals.
In the two product blocks (X) I get an error "The number of input rows must be a multiple of the decimation factor". I tried adding the convert blocks and specifying output type fixdt(1,20,18), but that didn’t help. The NCO is generating the proper sin and cos with amplitude +/-1 and frequency 13.5MHz with a 256Mhz sample rate.
What is the trick to getting the CIC to work? I looked at a similar Matlab Example for a GSM dds and it worked, but there was nothing special done (that I could see) to make the CIC input data types correct. Please help, I’ve spent a day chasing this problem 🙁 I am trying a simple Simulink model of an NCO generating a sin and cos which I then use in their own respective CIC decimator to generate quad and real output signals.
In the two product blocks (X) I get an error "The number of input rows must be a multiple of the decimation factor". I tried adding the convert blocks and specifying output type fixdt(1,20,18), but that didn’t help. The NCO is generating the proper sin and cos with amplitude +/-1 and frequency 13.5MHz with a 256Mhz sample rate.
What is the trick to getting the CIC to work? I looked at a similar Matlab Example for a GSM dds and it worked, but there was nothing special done (that I could see) to make the CIC input data types correct. Please help, I’ve spent a day chasing this problem 🙁 #cic, #simulink MATLAB Answers — New Questions
Slicing arrays and save it in the file
Hello,
I have a file of the following form:
data condition device
-297.367190000000 8 1
-295.132890000000 8 1
-268.007000000000 8 2
-268.007000000000 8 2
-262.109380000000 7 1
-263.296880000000 7 1
-263.562500000000 7 2
-263.562500000000 7 2
-258.973210000000 6 1
-255.209820000000 6 1
-255.209820000000 6 2
-255.209820000000 6 2
I would like to process the data being a slice of array for the given condition and device for instance one slice would be:
-297.367190000000 8 1
-295.132890000000 8 1
and save the result in file with the following format for instance for the data above:
dataProcessed_condition8_device1
How could I cut such slice and save it in the file of the described format?
Regards
ElzbietaHello,
I have a file of the following form:
data condition device
-297.367190000000 8 1
-295.132890000000 8 1
-268.007000000000 8 2
-268.007000000000 8 2
-262.109380000000 7 1
-263.296880000000 7 1
-263.562500000000 7 2
-263.562500000000 7 2
-258.973210000000 6 1
-255.209820000000 6 1
-255.209820000000 6 2
-255.209820000000 6 2
I would like to process the data being a slice of array for the given condition and device for instance one slice would be:
-297.367190000000 8 1
-295.132890000000 8 1
and save the result in file with the following format for instance for the data above:
dataProcessed_condition8_device1
How could I cut such slice and save it in the file of the described format?
Regards
Elzbieta Hello,
I have a file of the following form:
data condition device
-297.367190000000 8 1
-295.132890000000 8 1
-268.007000000000 8 2
-268.007000000000 8 2
-262.109380000000 7 1
-263.296880000000 7 1
-263.562500000000 7 2
-263.562500000000 7 2
-258.973210000000 6 1
-255.209820000000 6 1
-255.209820000000 6 2
-255.209820000000 6 2
I would like to process the data being a slice of array for the given condition and device for instance one slice would be:
-297.367190000000 8 1
-295.132890000000 8 1
and save the result in file with the following format for instance for the data above:
dataProcessed_condition8_device1
How could I cut such slice and save it in the file of the described format?
Regards
Elzbieta slice array MATLAB Answers — New Questions
Error message when using timers in AppDesigner after a few seconds running
I’m quite new to using timers in Matlab, and currently I’m running a project that will need them to continuously update some info in our App Designer window. The problem is, I followed the instructions in this tutorial from Matlab and initially my timer and callback function work normally. But after some time of it running I receive the following error message:
Error while evaluating TimerFcn for timer ‘timer-1’
Not enough input arguments.
I currently initialize my timer in the startupFcn of the app as:
function startupFcn(app)
global params
app.textbox_Log.Value = {‘Start’};
app.timerCounter1sec = 0;
app.timerCounter10sec = 0;
app.logStatus = ‘running’;
app.timer500ms = timer(‘Period’,0.5,…
‘ExecutionMode’, ‘fixedSpacing’, …
‘TasksToExecute’, Inf, …
‘BusyMode’, ‘drop’, …
‘TimerFcn’, @app.timerTest);
start(app.timer500ms);
updateJobList(app, params);
fillJobsTable(app, params);
end
And my callback function is defined as the following (I will omit the code for now since I don’t think it’s that important right now):
function timerTest(app,~,~)
% Function details…
end
Can someone help me with this? I have no clue of what is happening to throw this error in the timer, even considering that it works for around 3-4 seconds before breaking.I’m quite new to using timers in Matlab, and currently I’m running a project that will need them to continuously update some info in our App Designer window. The problem is, I followed the instructions in this tutorial from Matlab and initially my timer and callback function work normally. But after some time of it running I receive the following error message:
Error while evaluating TimerFcn for timer ‘timer-1’
Not enough input arguments.
I currently initialize my timer in the startupFcn of the app as:
function startupFcn(app)
global params
app.textbox_Log.Value = {‘Start’};
app.timerCounter1sec = 0;
app.timerCounter10sec = 0;
app.logStatus = ‘running’;
app.timer500ms = timer(‘Period’,0.5,…
‘ExecutionMode’, ‘fixedSpacing’, …
‘TasksToExecute’, Inf, …
‘BusyMode’, ‘drop’, …
‘TimerFcn’, @app.timerTest);
start(app.timer500ms);
updateJobList(app, params);
fillJobsTable(app, params);
end
And my callback function is defined as the following (I will omit the code for now since I don’t think it’s that important right now):
function timerTest(app,~,~)
% Function details…
end
Can someone help me with this? I have no clue of what is happening to throw this error in the timer, even considering that it works for around 3-4 seconds before breaking. I’m quite new to using timers in Matlab, and currently I’m running a project that will need them to continuously update some info in our App Designer window. The problem is, I followed the instructions in this tutorial from Matlab and initially my timer and callback function work normally. But after some time of it running I receive the following error message:
Error while evaluating TimerFcn for timer ‘timer-1’
Not enough input arguments.
I currently initialize my timer in the startupFcn of the app as:
function startupFcn(app)
global params
app.textbox_Log.Value = {‘Start’};
app.timerCounter1sec = 0;
app.timerCounter10sec = 0;
app.logStatus = ‘running’;
app.timer500ms = timer(‘Period’,0.5,…
‘ExecutionMode’, ‘fixedSpacing’, …
‘TasksToExecute’, Inf, …
‘BusyMode’, ‘drop’, …
‘TimerFcn’, @app.timerTest);
start(app.timer500ms);
updateJobList(app, params);
fillJobsTable(app, params);
end
And my callback function is defined as the following (I will omit the code for now since I don’t think it’s that important right now):
function timerTest(app,~,~)
% Function details…
end
Can someone help me with this? I have no clue of what is happening to throw this error in the timer, even considering that it works for around 3-4 seconds before breaking. timer, appdesigner, app designer, handles, error, input argument MATLAB Answers — New Questions
Problem with Fast Restart and Simulink Scenario Reader
Hello everyone,
I’m trying to train an RL agent on a vehicle to brake when encountering a pedestrian. I have set up a scenario using the driving scenario toolbox and everything in simulink to make it work.
I just have one problem: I’d like to randomize the pedestrian’s position, so I created a random function in the scenario definition script, but when I use fast restart the scenario reader gets stuck on the first simulation scenario. If I don’t, Simulink recompiles and everything works.
Is there a way to not disable fast restart, but still completely restart the scenario with variations?Hello everyone,
I’m trying to train an RL agent on a vehicle to brake when encountering a pedestrian. I have set up a scenario using the driving scenario toolbox and everything in simulink to make it work.
I just have one problem: I’d like to randomize the pedestrian’s position, so I created a random function in the scenario definition script, but when I use fast restart the scenario reader gets stuck on the first simulation scenario. If I don’t, Simulink recompiles and everything works.
Is there a way to not disable fast restart, but still completely restart the scenario with variations? Hello everyone,
I’m trying to train an RL agent on a vehicle to brake when encountering a pedestrian. I have set up a scenario using the driving scenario toolbox and everything in simulink to make it work.
I just have one problem: I’d like to randomize the pedestrian’s position, so I created a random function in the scenario definition script, but when I use fast restart the scenario reader gets stuck on the first simulation scenario. If I don’t, Simulink recompiles and everything works.
Is there a way to not disable fast restart, but still completely restart the scenario with variations? fast restart, driving scenario, reinforcement learning toolbox, reset scenario MATLAB Answers — New Questions
I want to plot RMSE from mat file but it gives error
When I run the m file, it gives me he following error:
Operator ‘-‘ is not supported for operands of type ‘cell’.
Error in RMSE_Plot (line 5)
MSE = mean((u-two).^2,2);
>>When I run the m file, it gives me he following error:
Operator ‘-‘ is not supported for operands of type ‘cell’.
Error in RMSE_Plot (line 5)
MSE = mean((u-two).^2,2);
>> When I run the m file, it gives me he following error:
Operator ‘-‘ is not supported for operands of type ‘cell’.
Error in RMSE_Plot (line 5)
MSE = mean((u-two).^2,2);
>> code gives error, rmse error, plotting, mat file MATLAB Answers — New Questions
Error while running NR Intercell Interference Model
Dear All,
Thanks in advance. Do I need to include any package?
==================code
wirelessnetworkSupportPackageCheck
rng("default") % Reset the random number generator
numFrameSimulation = 20; % Simulation time in terms of number of 10 ms frames
networkSimulator = wirelessNetworkSimulator.init;
gNBPositions = [1700 600 30; 3000 600 30; 2500 2000 30];
gNBOfInterestIdx = 3; % Specify an integer value in the range [1, number of gNBs]
gNBNames = "gNB-" + (1:size(gNBPositions,1));
gNBs = nrGNB(Name=gNBNames,Position=gNBPositions,CarrierFrequency=2.5e9, …
ChannelBandwidth=10e6,SubcarrierSpacing=30e3,TransmitPower=32,ReceiveGain=11);
for gNBIdx = 1:length(gNBs)
% Resource allocation type value 0 indicates a noncontiguous allocation of
% frequency-domain resources in terms of RBGs
configureScheduler(gNBs(gNBIdx),ResourceAllocationType=0)
end
numCells = length(gNBs);
cellRadius = 500; % Radius of each cell (in meters)
numUEsPerCell = 4;
uePositions = generateUEPositions(cellRadius,gNBPositions,numUEsPerCell);
UEs = cell(numCells,1);
for cellIdx = 1:numCells
ueNames = "UE-" + (1:size(uePositions{cellIdx},1));
UEs{cellIdx} = nrUE(Name=ueNames,Position=uePositions{cellIdx},ReceiveGain=11);
connectUE(gNBs(cellIdx),UEs{cellIdx},FullBufferTraffic="DL")
end
addNodes(networkSimulator,gNBs);
for cellIdx = 1:numCells
addNodes(networkSimulator,UEs{cellIdx})
end
channelModel = "3GPP TR 38.901";
if strcmp(channelModel,"3GPP TR 38.901")
% Define scenario boundaries
pos = [reshape([gNBs.Position],3,[])];
minX = min(pos(1,:)); % x-coordinate of the left edge of the scenario in meters
minY = min(pos(2,:)); % y-coordinate of the bottom edge of the scenario in meters
width = max(pos(1,:)) – minX; % Width (right edge of the 2D scenario) in meters, given as maxX – minX
height = max(pos(2,:)) – minY; % Height (top edge of the 2D scenario) in meters, given as maxY – minY
% Create the channel model
channel = h38901Channel(Scenario="UMa",ScenarioExtents=[minX minY width height]);
% Add the channel model to the simulator
addChannelModel(networkSimulator,@channel.channelFunction);
connectNodes(channel,networkSimulator,InterfererHasSmallScale=true);
end
cellToAnalyze = gNBs(gNBOfInterestIdx).ID;
enableTraces = true;
linkDir = 0; % Indicates DL
if enableTraces
simSchedulingLogger = cell(numCells,1);
simPhyLogger = cell(numCells,1);
for cellIdx = 1:numCells
% Create an object for MAC DL scheduling traces logging
simSchedulingLogger{cellIdx} = helperNRSchedulingLogger(numFrameSimulation, …
gNBs(cellToAnalyze),UEs{cellToAnalyze},LinkDirection=linkDir);
% Create an object for PHY layer traces logging
simPhyLogger{cellIdx} = helperNRPhyLogger(numFrameSimulation,gNBs(cellToAnalyze), …
UEs{cellToAnalyze});
end
end
numMetricPlotUpdates = numFrameSimulation;
showSchedulerMetrics = true;
showPhyMetrics = true;
metricsVisualizer = helperNRMetricsVisualizer(gNBs(cellToAnalyze),UEs{cellToAnalyze}, …
CellOfInterest=cellToAnalyze,NumMetricsSteps=numMetricPlotUpdates, …
PlotSchedulerMetrics=showSchedulerMetrics,PlotPhyMetrics=showPhyMetrics,LinkDirection=linkDir);
simulationLogFile = "simulationLogs"; % For logging the simulation traces
enableMobility = false;
if enableMobility
ueSpeedRange = [1 1000]; % In meters per second
ueWithMobility = UEs{cellToAnalyze}(2); % Get UE-2 in the cell of interest
% Add random waypoint mobility to the selected UE
addMobility(ueWithMobility,SpeedRange=ueSpeedRange,BoundaryShape="circle",Bounds=[gNBs(cellToAnalyze).Position(1:2) cellRadius])
end
networkVisualizer = helperNetworkVisualizer(SampleRate=100); % Sample rate indicates the visualization refresh rate in Hertz
% Show the cell boundary of each gNB
showBoundaries(networkVisualizer,gNBPositions,cellRadius,cellToAnalyze)
% Calculate the simulation duration (in seconds)
simulationTime = numFrameSimulation*1e-2;
% Run the simulation
run(networkSimulator,simulationTime);
========================================================code
Error=====================================================
>> test001
Error using nrGNB/getMCSTable (line 1331)
Invalid default value for property ‘MCSTable’ in class ‘nrGNB’:
Unable to resolve the name ‘nr5g.internal.MACConstants.MCSTable’.
Error in test001 (line 8)
gNBs = nrGNB(Name=gNBNames,Position=gNBPositions,CarrierFrequency=2.5e9, …Dear All,
Thanks in advance. Do I need to include any package?
==================code
wirelessnetworkSupportPackageCheck
rng("default") % Reset the random number generator
numFrameSimulation = 20; % Simulation time in terms of number of 10 ms frames
networkSimulator = wirelessNetworkSimulator.init;
gNBPositions = [1700 600 30; 3000 600 30; 2500 2000 30];
gNBOfInterestIdx = 3; % Specify an integer value in the range [1, number of gNBs]
gNBNames = "gNB-" + (1:size(gNBPositions,1));
gNBs = nrGNB(Name=gNBNames,Position=gNBPositions,CarrierFrequency=2.5e9, …
ChannelBandwidth=10e6,SubcarrierSpacing=30e3,TransmitPower=32,ReceiveGain=11);
for gNBIdx = 1:length(gNBs)
% Resource allocation type value 0 indicates a noncontiguous allocation of
% frequency-domain resources in terms of RBGs
configureScheduler(gNBs(gNBIdx),ResourceAllocationType=0)
end
numCells = length(gNBs);
cellRadius = 500; % Radius of each cell (in meters)
numUEsPerCell = 4;
uePositions = generateUEPositions(cellRadius,gNBPositions,numUEsPerCell);
UEs = cell(numCells,1);
for cellIdx = 1:numCells
ueNames = "UE-" + (1:size(uePositions{cellIdx},1));
UEs{cellIdx} = nrUE(Name=ueNames,Position=uePositions{cellIdx},ReceiveGain=11);
connectUE(gNBs(cellIdx),UEs{cellIdx},FullBufferTraffic="DL")
end
addNodes(networkSimulator,gNBs);
for cellIdx = 1:numCells
addNodes(networkSimulator,UEs{cellIdx})
end
channelModel = "3GPP TR 38.901";
if strcmp(channelModel,"3GPP TR 38.901")
% Define scenario boundaries
pos = [reshape([gNBs.Position],3,[])];
minX = min(pos(1,:)); % x-coordinate of the left edge of the scenario in meters
minY = min(pos(2,:)); % y-coordinate of the bottom edge of the scenario in meters
width = max(pos(1,:)) – minX; % Width (right edge of the 2D scenario) in meters, given as maxX – minX
height = max(pos(2,:)) – minY; % Height (top edge of the 2D scenario) in meters, given as maxY – minY
% Create the channel model
channel = h38901Channel(Scenario="UMa",ScenarioExtents=[minX minY width height]);
% Add the channel model to the simulator
addChannelModel(networkSimulator,@channel.channelFunction);
connectNodes(channel,networkSimulator,InterfererHasSmallScale=true);
end
cellToAnalyze = gNBs(gNBOfInterestIdx).ID;
enableTraces = true;
linkDir = 0; % Indicates DL
if enableTraces
simSchedulingLogger = cell(numCells,1);
simPhyLogger = cell(numCells,1);
for cellIdx = 1:numCells
% Create an object for MAC DL scheduling traces logging
simSchedulingLogger{cellIdx} = helperNRSchedulingLogger(numFrameSimulation, …
gNBs(cellToAnalyze),UEs{cellToAnalyze},LinkDirection=linkDir);
% Create an object for PHY layer traces logging
simPhyLogger{cellIdx} = helperNRPhyLogger(numFrameSimulation,gNBs(cellToAnalyze), …
UEs{cellToAnalyze});
end
end
numMetricPlotUpdates = numFrameSimulation;
showSchedulerMetrics = true;
showPhyMetrics = true;
metricsVisualizer = helperNRMetricsVisualizer(gNBs(cellToAnalyze),UEs{cellToAnalyze}, …
CellOfInterest=cellToAnalyze,NumMetricsSteps=numMetricPlotUpdates, …
PlotSchedulerMetrics=showSchedulerMetrics,PlotPhyMetrics=showPhyMetrics,LinkDirection=linkDir);
simulationLogFile = "simulationLogs"; % For logging the simulation traces
enableMobility = false;
if enableMobility
ueSpeedRange = [1 1000]; % In meters per second
ueWithMobility = UEs{cellToAnalyze}(2); % Get UE-2 in the cell of interest
% Add random waypoint mobility to the selected UE
addMobility(ueWithMobility,SpeedRange=ueSpeedRange,BoundaryShape="circle",Bounds=[gNBs(cellToAnalyze).Position(1:2) cellRadius])
end
networkVisualizer = helperNetworkVisualizer(SampleRate=100); % Sample rate indicates the visualization refresh rate in Hertz
% Show the cell boundary of each gNB
showBoundaries(networkVisualizer,gNBPositions,cellRadius,cellToAnalyze)
% Calculate the simulation duration (in seconds)
simulationTime = numFrameSimulation*1e-2;
% Run the simulation
run(networkSimulator,simulationTime);
========================================================code
Error=====================================================
>> test001
Error using nrGNB/getMCSTable (line 1331)
Invalid default value for property ‘MCSTable’ in class ‘nrGNB’:
Unable to resolve the name ‘nr5g.internal.MACConstants.MCSTable’.
Error in test001 (line 8)
gNBs = nrGNB(Name=gNBNames,Position=gNBPositions,CarrierFrequency=2.5e9, … Dear All,
Thanks in advance. Do I need to include any package?
==================code
wirelessnetworkSupportPackageCheck
rng("default") % Reset the random number generator
numFrameSimulation = 20; % Simulation time in terms of number of 10 ms frames
networkSimulator = wirelessNetworkSimulator.init;
gNBPositions = [1700 600 30; 3000 600 30; 2500 2000 30];
gNBOfInterestIdx = 3; % Specify an integer value in the range [1, number of gNBs]
gNBNames = "gNB-" + (1:size(gNBPositions,1));
gNBs = nrGNB(Name=gNBNames,Position=gNBPositions,CarrierFrequency=2.5e9, …
ChannelBandwidth=10e6,SubcarrierSpacing=30e3,TransmitPower=32,ReceiveGain=11);
for gNBIdx = 1:length(gNBs)
% Resource allocation type value 0 indicates a noncontiguous allocation of
% frequency-domain resources in terms of RBGs
configureScheduler(gNBs(gNBIdx),ResourceAllocationType=0)
end
numCells = length(gNBs);
cellRadius = 500; % Radius of each cell (in meters)
numUEsPerCell = 4;
uePositions = generateUEPositions(cellRadius,gNBPositions,numUEsPerCell);
UEs = cell(numCells,1);
for cellIdx = 1:numCells
ueNames = "UE-" + (1:size(uePositions{cellIdx},1));
UEs{cellIdx} = nrUE(Name=ueNames,Position=uePositions{cellIdx},ReceiveGain=11);
connectUE(gNBs(cellIdx),UEs{cellIdx},FullBufferTraffic="DL")
end
addNodes(networkSimulator,gNBs);
for cellIdx = 1:numCells
addNodes(networkSimulator,UEs{cellIdx})
end
channelModel = "3GPP TR 38.901";
if strcmp(channelModel,"3GPP TR 38.901")
% Define scenario boundaries
pos = [reshape([gNBs.Position],3,[])];
minX = min(pos(1,:)); % x-coordinate of the left edge of the scenario in meters
minY = min(pos(2,:)); % y-coordinate of the bottom edge of the scenario in meters
width = max(pos(1,:)) – minX; % Width (right edge of the 2D scenario) in meters, given as maxX – minX
height = max(pos(2,:)) – minY; % Height (top edge of the 2D scenario) in meters, given as maxY – minY
% Create the channel model
channel = h38901Channel(Scenario="UMa",ScenarioExtents=[minX minY width height]);
% Add the channel model to the simulator
addChannelModel(networkSimulator,@channel.channelFunction);
connectNodes(channel,networkSimulator,InterfererHasSmallScale=true);
end
cellToAnalyze = gNBs(gNBOfInterestIdx).ID;
enableTraces = true;
linkDir = 0; % Indicates DL
if enableTraces
simSchedulingLogger = cell(numCells,1);
simPhyLogger = cell(numCells,1);
for cellIdx = 1:numCells
% Create an object for MAC DL scheduling traces logging
simSchedulingLogger{cellIdx} = helperNRSchedulingLogger(numFrameSimulation, …
gNBs(cellToAnalyze),UEs{cellToAnalyze},LinkDirection=linkDir);
% Create an object for PHY layer traces logging
simPhyLogger{cellIdx} = helperNRPhyLogger(numFrameSimulation,gNBs(cellToAnalyze), …
UEs{cellToAnalyze});
end
end
numMetricPlotUpdates = numFrameSimulation;
showSchedulerMetrics = true;
showPhyMetrics = true;
metricsVisualizer = helperNRMetricsVisualizer(gNBs(cellToAnalyze),UEs{cellToAnalyze}, …
CellOfInterest=cellToAnalyze,NumMetricsSteps=numMetricPlotUpdates, …
PlotSchedulerMetrics=showSchedulerMetrics,PlotPhyMetrics=showPhyMetrics,LinkDirection=linkDir);
simulationLogFile = "simulationLogs"; % For logging the simulation traces
enableMobility = false;
if enableMobility
ueSpeedRange = [1 1000]; % In meters per second
ueWithMobility = UEs{cellToAnalyze}(2); % Get UE-2 in the cell of interest
% Add random waypoint mobility to the selected UE
addMobility(ueWithMobility,SpeedRange=ueSpeedRange,BoundaryShape="circle",Bounds=[gNBs(cellToAnalyze).Position(1:2) cellRadius])
end
networkVisualizer = helperNetworkVisualizer(SampleRate=100); % Sample rate indicates the visualization refresh rate in Hertz
% Show the cell boundary of each gNB
showBoundaries(networkVisualizer,gNBPositions,cellRadius,cellToAnalyze)
% Calculate the simulation duration (in seconds)
simulationTime = numFrameSimulation*1e-2;
% Run the simulation
run(networkSimulator,simulationTime);
========================================================code
Error=====================================================
>> test001
Error using nrGNB/getMCSTable (line 1331)
Invalid default value for property ‘MCSTable’ in class ‘nrGNB’:
Unable to resolve the name ‘nr5g.internal.MACConstants.MCSTable’.
Error in test001 (line 8)
gNBs = nrGNB(Name=gNBNames,Position=gNBPositions,CarrierFrequency=2.5e9, … matlab, 5g interferance MATLAB Answers — New Questions
Can we design a CNN Model in simulink
Can we model ourself a CNN Model using Deep learning toolbox in simulinkCan we model ourself a CNN Model using Deep learning toolbox in simulink Can we model ourself a CNN Model using Deep learning toolbox in simulink #deeplearning toolbox, simulink, deep learning MATLAB Answers — New Questions
times font with latex interpreter
Hello,
I have the same problem described in the threads below: I need to control the latex math font, specifically, I need to use the mathptmx package.
http://www.mathworks.com/matlabcentral/answers/10282-latex-interpreter-different-fonts
http://www.mathworks.com/matlabcentral/newsreader/view_thread/283068
In this second thread, Huy Phan describes a way of hacking into the tex.m file and adding usepackage{whatever} to the standardhead variable in localDecorateInputString. I have made it to Step 3 of Huy Phan’s procedure, but have not had luck getting much further, I suspect because the path dependencies are a rabbit hole. It is not clear if it worked out for the others in the thread either.
Here are a couple of simple examples illustrating what I would like to do. First is a .tex file that runs fine with my texlive distribution:
documentclass{mwarticle}
usepackage{mathptmx}
begin{document}
This is a short article for testing fonts. Here is some math stuff: $y = x$.
end{document}
Next is a Matlab figure:
figure(1);
text(.5,.5,’$y=x$’,’interpreter’,’latex’)
I would like to get the y=x in the Matlab figure to use the same Times font produced using texlive.
Is there a way to get Matlab to run latex from texlive? Or does anyone think they can get Huy Phan’s method working for mathptmx? I have tried adding all the directories shown in the log file from texlive to the TeXPath in tex.m, but this had not solved the problem.
Many thanks!
RandyHello,
I have the same problem described in the threads below: I need to control the latex math font, specifically, I need to use the mathptmx package.
http://www.mathworks.com/matlabcentral/answers/10282-latex-interpreter-different-fonts
http://www.mathworks.com/matlabcentral/newsreader/view_thread/283068
In this second thread, Huy Phan describes a way of hacking into the tex.m file and adding usepackage{whatever} to the standardhead variable in localDecorateInputString. I have made it to Step 3 of Huy Phan’s procedure, but have not had luck getting much further, I suspect because the path dependencies are a rabbit hole. It is not clear if it worked out for the others in the thread either.
Here are a couple of simple examples illustrating what I would like to do. First is a .tex file that runs fine with my texlive distribution:
documentclass{mwarticle}
usepackage{mathptmx}
begin{document}
This is a short article for testing fonts. Here is some math stuff: $y = x$.
end{document}
Next is a Matlab figure:
figure(1);
text(.5,.5,’$y=x$’,’interpreter’,’latex’)
I would like to get the y=x in the Matlab figure to use the same Times font produced using texlive.
Is there a way to get Matlab to run latex from texlive? Or does anyone think they can get Huy Phan’s method working for mathptmx? I have tried adding all the directories shown in the log file from texlive to the TeXPath in tex.m, but this had not solved the problem.
Many thanks!
Randy Hello,
I have the same problem described in the threads below: I need to control the latex math font, specifically, I need to use the mathptmx package.
http://www.mathworks.com/matlabcentral/answers/10282-latex-interpreter-different-fonts
http://www.mathworks.com/matlabcentral/newsreader/view_thread/283068
In this second thread, Huy Phan describes a way of hacking into the tex.m file and adding usepackage{whatever} to the standardhead variable in localDecorateInputString. I have made it to Step 3 of Huy Phan’s procedure, but have not had luck getting much further, I suspect because the path dependencies are a rabbit hole. It is not clear if it worked out for the others in the thread either.
Here are a couple of simple examples illustrating what I would like to do. First is a .tex file that runs fine with my texlive distribution:
documentclass{mwarticle}
usepackage{mathptmx}
begin{document}
This is a short article for testing fonts. Here is some math stuff: $y = x$.
end{document}
Next is a Matlab figure:
figure(1);
text(.5,.5,’$y=x$’,’interpreter’,’latex’)
I would like to get the y=x in the Matlab figure to use the same Times font produced using texlive.
Is there a way to get Matlab to run latex from texlive? Or does anyone think they can get Huy Phan’s method working for mathptmx? I have tried adding all the directories shown in the log file from texlive to the TeXPath in tex.m, but this had not solved the problem.
Many thanks!
Randy times font, latex MATLAB Answers — New Questions
LSTM for Battery prediction
Hello everyone,
I am currently working on estimating the lifespan of batteries using an LSTM network. The sequence length varies with each cycle. Unfortunately, the results have been very poor so far, as it seems the network is not reading the entire sequence of data correctly.
Below you will find the code for the neural network and a plot comparing the real data with the LSTM predictions.
I would greatly appreciate your support and advice!
Thank you in advance!
% Example data preparation
cycles = 167;
for i = 1:cycles
% Fill these with your actual data
voltageData{i} = normal(cha(i).data.Voltage_measured);
currentData{i} = normal(cha(i).data.Current_measured);
timeData{i} = normal(cha(i).data.Time);
temperatureData{i} = normal(cha(i).data.Temperature_measured);
%capacities(i) = …; % Actual capacity value for the i-th cycle
end
for i = 1:cycles
X{i,:} = [voltageData{i}; currentData{i}; timeData{i}; temperatureData{i}];
end
Y=normal(capa)’;
% Split data into training (70%), validation (15%), and test (15%) sets
TrainAmout = round(0.7 * cycles);
ValAmout = round(0.15 * cycles);
TestAmout = cycles – TrainAmout – ValAmout;
Index = randperm(cycles);
trainIndex = Index(1:TrainAmout);
valIndex = Index(TrainAmout+1:TrainAmout+ValAmout);
testIndex = Index(TrainAmout+ValAmout+1:end);
XTrain = X(trainIndex);
YTrain = Y(trainIndex);
XVal = X(valIndex);
YVal = Y(valIndex);
XTest = X(testIndex);
YTest = Y(testIndex);
inputSize = 4; % Four input features: voltage, current, time, temperature
numHiddenUnits = 50; % Number of hidden units in the LSTM layer
outputSize = 1; % Single output representing capacity
layers = [ …
sequenceInputLayer(inputSize)
lstmLayer(numHiddenUnits, ‘OutputMode’, ‘last’)
fullyConnectedLayer(outputSize)
regressionLayer];
% Set training options with validation data
options = trainingOptions(‘adam’, …
‘MaxEpochs’, 100, …
‘MiniBatchSize’, 10, …
‘InitialLearnRate’, 0.01, …
‘GradientThreshold’, 1, …
‘ValidationData’, {XVal, YVal}, …
‘ValidationFrequency’, 30, …
‘Verbose’, false, …
‘Plots’, ‘training-progress’);
% Train the network
net = trainNetwork(XTrain, YTrain, layers, options);Hello everyone,
I am currently working on estimating the lifespan of batteries using an LSTM network. The sequence length varies with each cycle. Unfortunately, the results have been very poor so far, as it seems the network is not reading the entire sequence of data correctly.
Below you will find the code for the neural network and a plot comparing the real data with the LSTM predictions.
I would greatly appreciate your support and advice!
Thank you in advance!
% Example data preparation
cycles = 167;
for i = 1:cycles
% Fill these with your actual data
voltageData{i} = normal(cha(i).data.Voltage_measured);
currentData{i} = normal(cha(i).data.Current_measured);
timeData{i} = normal(cha(i).data.Time);
temperatureData{i} = normal(cha(i).data.Temperature_measured);
%capacities(i) = …; % Actual capacity value for the i-th cycle
end
for i = 1:cycles
X{i,:} = [voltageData{i}; currentData{i}; timeData{i}; temperatureData{i}];
end
Y=normal(capa)’;
% Split data into training (70%), validation (15%), and test (15%) sets
TrainAmout = round(0.7 * cycles);
ValAmout = round(0.15 * cycles);
TestAmout = cycles – TrainAmout – ValAmout;
Index = randperm(cycles);
trainIndex = Index(1:TrainAmout);
valIndex = Index(TrainAmout+1:TrainAmout+ValAmout);
testIndex = Index(TrainAmout+ValAmout+1:end);
XTrain = X(trainIndex);
YTrain = Y(trainIndex);
XVal = X(valIndex);
YVal = Y(valIndex);
XTest = X(testIndex);
YTest = Y(testIndex);
inputSize = 4; % Four input features: voltage, current, time, temperature
numHiddenUnits = 50; % Number of hidden units in the LSTM layer
outputSize = 1; % Single output representing capacity
layers = [ …
sequenceInputLayer(inputSize)
lstmLayer(numHiddenUnits, ‘OutputMode’, ‘last’)
fullyConnectedLayer(outputSize)
regressionLayer];
% Set training options with validation data
options = trainingOptions(‘adam’, …
‘MaxEpochs’, 100, …
‘MiniBatchSize’, 10, …
‘InitialLearnRate’, 0.01, …
‘GradientThreshold’, 1, …
‘ValidationData’, {XVal, YVal}, …
‘ValidationFrequency’, 30, …
‘Verbose’, false, …
‘Plots’, ‘training-progress’);
% Train the network
net = trainNetwork(XTrain, YTrain, layers, options); Hello everyone,
I am currently working on estimating the lifespan of batteries using an LSTM network. The sequence length varies with each cycle. Unfortunately, the results have been very poor so far, as it seems the network is not reading the entire sequence of data correctly.
Below you will find the code for the neural network and a plot comparing the real data with the LSTM predictions.
I would greatly appreciate your support and advice!
Thank you in advance!
% Example data preparation
cycles = 167;
for i = 1:cycles
% Fill these with your actual data
voltageData{i} = normal(cha(i).data.Voltage_measured);
currentData{i} = normal(cha(i).data.Current_measured);
timeData{i} = normal(cha(i).data.Time);
temperatureData{i} = normal(cha(i).data.Temperature_measured);
%capacities(i) = …; % Actual capacity value for the i-th cycle
end
for i = 1:cycles
X{i,:} = [voltageData{i}; currentData{i}; timeData{i}; temperatureData{i}];
end
Y=normal(capa)’;
% Split data into training (70%), validation (15%), and test (15%) sets
TrainAmout = round(0.7 * cycles);
ValAmout = round(0.15 * cycles);
TestAmout = cycles – TrainAmout – ValAmout;
Index = randperm(cycles);
trainIndex = Index(1:TrainAmout);
valIndex = Index(TrainAmout+1:TrainAmout+ValAmout);
testIndex = Index(TrainAmout+ValAmout+1:end);
XTrain = X(trainIndex);
YTrain = Y(trainIndex);
XVal = X(valIndex);
YVal = Y(valIndex);
XTest = X(testIndex);
YTest = Y(testIndex);
inputSize = 4; % Four input features: voltage, current, time, temperature
numHiddenUnits = 50; % Number of hidden units in the LSTM layer
outputSize = 1; % Single output representing capacity
layers = [ …
sequenceInputLayer(inputSize)
lstmLayer(numHiddenUnits, ‘OutputMode’, ‘last’)
fullyConnectedLayer(outputSize)
regressionLayer];
% Set training options with validation data
options = trainingOptions(‘adam’, …
‘MaxEpochs’, 100, …
‘MiniBatchSize’, 10, …
‘InitialLearnRate’, 0.01, …
‘GradientThreshold’, 1, …
‘ValidationData’, {XVal, YVal}, …
‘ValidationFrequency’, 30, …
‘Verbose’, false, …
‘Plots’, ‘training-progress’);
% Train the network
net = trainNetwork(XTrain, YTrain, layers, options); deep learning, neural networks MATLAB Answers — New Questions
Taking outer product of two matrices
I have a 3×3 displacement matrix (let us call it u). The displacement gradient tensor F is given by
F = I + ∇ ⊗ u
where,
I = identity matrix
∇ = gradient operator
Can someone help me code this in MATLAB?I have a 3×3 displacement matrix (let us call it u). The displacement gradient tensor F is given by
F = I + ∇ ⊗ u
where,
I = identity matrix
∇ = gradient operator
Can someone help me code this in MATLAB? I have a 3×3 displacement matrix (let us call it u). The displacement gradient tensor F is given by
F = I + ∇ ⊗ u
where,
I = identity matrix
∇ = gradient operator
Can someone help me code this in MATLAB? deformation MATLAB Answers — New Questions
How do I call Simulink from Within Matlab then go back to the M-file software?
Alright, I need to call a Simulink file from an M file as though it were a subroutine. How do I call the Simulink file from within an M-file then return control to the M-file? Again, I would like to use the Simulink file like a subroutine. Can I do that? We’ll say the Simulink file that I want to use is called PlaneCalcs and I don’t know what the extension on that should be, which should give you some idea of how much of a newbie I am.
Can you also provide me with how I would transfer data to the Simulink file (call it "PlaneCalcs") then load that data into an input that would then feed an integrator. I’ve been told that I can use a multiplexer to supply the input to the Simulink integrator.
Please keep your response as basic as possible. Too much data will overload my mind and make your answer useless. I have NO SIMULINK background, so please don’t tell me to use fancy function names. I’ll probably need to multiply the inputs by a matrix. Again, can you tell me what to use to do this multiplication?
Also, how do I write a Simulink file and name it PlaneCalcs, so I can access it via the M-file?Alright, I need to call a Simulink file from an M file as though it were a subroutine. How do I call the Simulink file from within an M-file then return control to the M-file? Again, I would like to use the Simulink file like a subroutine. Can I do that? We’ll say the Simulink file that I want to use is called PlaneCalcs and I don’t know what the extension on that should be, which should give you some idea of how much of a newbie I am.
Can you also provide me with how I would transfer data to the Simulink file (call it "PlaneCalcs") then load that data into an input that would then feed an integrator. I’ve been told that I can use a multiplexer to supply the input to the Simulink integrator.
Please keep your response as basic as possible. Too much data will overload my mind and make your answer useless. I have NO SIMULINK background, so please don’t tell me to use fancy function names. I’ll probably need to multiply the inputs by a matrix. Again, can you tell me what to use to do this multiplication?
Also, how do I write a Simulink file and name it PlaneCalcs, so I can access it via the M-file? Alright, I need to call a Simulink file from an M file as though it were a subroutine. How do I call the Simulink file from within an M-file then return control to the M-file? Again, I would like to use the Simulink file like a subroutine. Can I do that? We’ll say the Simulink file that I want to use is called PlaneCalcs and I don’t know what the extension on that should be, which should give you some idea of how much of a newbie I am.
Can you also provide me with how I would transfer data to the Simulink file (call it "PlaneCalcs") then load that data into an input that would then feed an integrator. I’ve been told that I can use a multiplexer to supply the input to the Simulink integrator.
Please keep your response as basic as possible. Too much data will overload my mind and make your answer useless. I have NO SIMULINK background, so please don’t tell me to use fancy function names. I’ll probably need to multiply the inputs by a matrix. Again, can you tell me what to use to do this multiplication?
Also, how do I write a Simulink file and name it PlaneCalcs, so I can access it via the M-file? matlab m-file simulink joined MATLAB Answers — New Questions