Category: Matlab
Category Archives: Matlab
fixdt outof bounds error for data conversion block
An error occurred during simulation and the simulation was terminated
Caused by:
Input value of block ‘dvbs2hdlLDPCEncoder/DVB-S2 LDPC Encoder/Parity Address Generator/ramLUT1’ exceeds range of breakpoint vector for dimension 2.
my fixdt(0,4,0) for conversion block is camped to 13 matching the maximum column dimension of my ramLUT 2-D. Still it throws me this error.An error occurred during simulation and the simulation was terminated
Caused by:
Input value of block ‘dvbs2hdlLDPCEncoder/DVB-S2 LDPC Encoder/Parity Address Generator/ramLUT1’ exceeds range of breakpoint vector for dimension 2.
my fixdt(0,4,0) for conversion block is camped to 13 matching the maximum column dimension of my ramLUT 2-D. Still it throws me this error. An error occurred during simulation and the simulation was terminated
Caused by:
Input value of block ‘dvbs2hdlLDPCEncoder/DVB-S2 LDPC Encoder/Parity Address Generator/ramLUT1’ exceeds range of breakpoint vector for dimension 2.
my fixdt(0,4,0) for conversion block is camped to 13 matching the maximum column dimension of my ramLUT 2-D. Still it throws me this error. fixed-point, simulink, convert MATLAB Answers — New Questions
How to connect a Basler camera to MATLAB
Hi everyone,
I have a Basler acA1920-155um that I am trying to connect to MATLAB using USB 3.0. This has proven more difficult than anticipated.
I’ve followed this (outdated) guide:
https://www2.baslerweb.com/media/downloads/documents/application_notes/AW00134303000_Application_Note_Basler_pylon_GenTL_Producers_with_….pdf
My understanding of what should happen is this:
1. Install the current version of the Basler Pylon Software Suite
2. Install the Image Acquisition toolbox
3. Download the GenTL support package via MATLAB
and….it should work. I open the image acquisition app in MATLAB and it does not find any cameras. I checked using imacqhwinfo and it does show that the GenTL diver is present, but no devices.
What I’ve tried:
I’ve attempted to download the Pylon SDK, and the GenTL drivers to replace them, to no avail.
The camera runs fine in Basler Pylon Viewer so I know it’s not a physical connection problem.
Any guidance is appreciated.Hi everyone,
I have a Basler acA1920-155um that I am trying to connect to MATLAB using USB 3.0. This has proven more difficult than anticipated.
I’ve followed this (outdated) guide:
https://www2.baslerweb.com/media/downloads/documents/application_notes/AW00134303000_Application_Note_Basler_pylon_GenTL_Producers_with_….pdf
My understanding of what should happen is this:
1. Install the current version of the Basler Pylon Software Suite
2. Install the Image Acquisition toolbox
3. Download the GenTL support package via MATLAB
and….it should work. I open the image acquisition app in MATLAB and it does not find any cameras. I checked using imacqhwinfo and it does show that the GenTL diver is present, but no devices.
What I’ve tried:
I’ve attempted to download the Pylon SDK, and the GenTL drivers to replace them, to no avail.
The camera runs fine in Basler Pylon Viewer so I know it’s not a physical connection problem.
Any guidance is appreciated. Hi everyone,
I have a Basler acA1920-155um that I am trying to connect to MATLAB using USB 3.0. This has proven more difficult than anticipated.
I’ve followed this (outdated) guide:
https://www2.baslerweb.com/media/downloads/documents/application_notes/AW00134303000_Application_Note_Basler_pylon_GenTL_Producers_with_….pdf
My understanding of what should happen is this:
1. Install the current version of the Basler Pylon Software Suite
2. Install the Image Acquisition toolbox
3. Download the GenTL support package via MATLAB
and….it should work. I open the image acquisition app in MATLAB and it does not find any cameras. I checked using imacqhwinfo and it does show that the GenTL diver is present, but no devices.
What I’ve tried:
I’ve attempted to download the Pylon SDK, and the GenTL drivers to replace them, to no avail.
The camera runs fine in Basler Pylon Viewer so I know it’s not a physical connection problem.
Any guidance is appreciated. basler, cameras, hardware, image acquisition, gentl, image processing, digital image processing MATLAB Answers — New Questions
rmpath does not remove folders on path
>> rmpath(‘/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/’);
Warning: "/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1" not found in path.
> In rmpath>doRemoveFromPath (line 102)
In rmpath (line 59)
>> rmpath(‘/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1’);
Warning: "/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1" not found in path.
> In rmpath>doRemoveFromPath (line 102)
In rmpath (line 59)
>> doc rmpath
>> path
MATLABPATH %%% matlabCP1 manifestly remains on path
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/turbulence/CP1
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/io
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models/skyrmions
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models/velocity>> rmpath(‘/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/’);
Warning: "/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1" not found in path.
> In rmpath>doRemoveFromPath (line 102)
In rmpath (line 59)
>> rmpath(‘/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1’);
Warning: "/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1" not found in path.
> In rmpath>doRemoveFromPath (line 102)
In rmpath (line 59)
>> doc rmpath
>> path
MATLABPATH %%% matlabCP1 manifestly remains on path
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/turbulence/CP1
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/io
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models/skyrmions
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models/velocity >> rmpath(‘/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/’);
Warning: "/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1" not found in path.
> In rmpath>doRemoveFromPath (line 102)
In rmpath (line 59)
>> rmpath(‘/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1’);
Warning: "/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1" not found in path.
> In rmpath>doRemoveFromPath (line 102)
In rmpath (line 59)
>> doc rmpath
>> path
MATLABPATH %%% matlabCP1 manifestly remains on path
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/turbulence/CP1
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/io
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models/skyrmions
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models/velocity rmpath MATLAB Answers — New Questions
TDMS. data file conversion to csv. file
Hello Matlab users,
Can anyone please help me to convert my multiple tdms file in csv format?
Thank you in advanceHello Matlab users,
Can anyone please help me to convert my multiple tdms file in csv format?
Thank you in advance Hello Matlab users,
Can anyone please help me to convert my multiple tdms file in csv format?
Thank you in advance tdms, csv, signal, conversion, mathematics MATLAB Answers — New Questions
HDL Coder Error when converting AXI4 interface with different data rates
I’m having trouble understanding this error from HDL coder:
Failed All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port "data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
Error using hdlturnkey.data.Channel/validateCodeGenPortRate
All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port
"data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
I want to read from a particular address in memory every 5 us. I don’t want to read every 2e-7 seconds and flood the bus with uneeded read requests. I tried checking the timing legend and nothing even seems to be running at 2e-07 so i’m not sure where it is getting that rate from in the first place.
Am i approaching the sampling logic for this incorrectly? Instead of controlling when it performs a read by changing the execution time of the read-slave-to-master interface and Data signals, should i let the execution time be set to -1 (inherited) and control the read time by changing the rd_dvalid signal using temporal logic in my stateflow chart? Thanks for any help.I’m having trouble understanding this error from HDL coder:
Failed All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port "data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
Error using hdlturnkey.data.Channel/validateCodeGenPortRate
All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port
"data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
I want to read from a particular address in memory every 5 us. I don’t want to read every 2e-7 seconds and flood the bus with uneeded read requests. I tried checking the timing legend and nothing even seems to be running at 2e-07 so i’m not sure where it is getting that rate from in the first place.
Am i approaching the sampling logic for this incorrectly? Instead of controlling when it performs a read by changing the execution time of the read-slave-to-master interface and Data signals, should i let the execution time be set to -1 (inherited) and control the read time by changing the rd_dvalid signal using temporal logic in my stateflow chart? Thanks for any help. I’m having trouble understanding this error from HDL coder:
Failed All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port "data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
Error using hdlturnkey.data.Channel/validateCodeGenPortRate
All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port
"data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
I want to read from a particular address in memory every 5 us. I don’t want to read every 2e-7 seconds and flood the bus with uneeded read requests. I tried checking the timing legend and nothing even seems to be running at 2e-07 so i’m not sure where it is getting that rate from in the first place.
Am i approaching the sampling logic for this incorrectly? Instead of controlling when it performs a read by changing the execution time of the read-slave-to-master interface and Data signals, should i let the execution time be set to -1 (inherited) and control the read time by changing the rd_dvalid signal using temporal logic in my stateflow chart? Thanks for any help. hdl coder MATLAB Answers — New Questions
Impossible to install the latest version of Matlab Connector on a Linux computer
I have installed the latest version of 2025b on a Linux system with Ubuntu 24.04.2 LTS.
It is not possible to install the Matlab connector (2025.11.0.2). The process is terminated and the following error is thrown:
Gtk-Message: 11:08:08.425: Failed to load module "gail"
Gtk-Message: 11:08:08.425: Failed to load module "atk-bridge"
I have never had any issues with the Connector whatsoever in the past. Following suggestions from the helpdesk, I did several things already: installing from a different folder, bypassing the firewall, disabling the router, install but not as superuser, fresh Matlab install, etc. It seems the installer completes extraction but fails to start services.
I am very much dependent on the Connector and it is very frustrating that 2025b & Connector do not work out-of-the-box. Furthermore, the process of troubleshooting has become beyond my expertise. What steps can I take to make it work? Is there a way to generate a log or something that can be used to understand the issue?I have installed the latest version of 2025b on a Linux system with Ubuntu 24.04.2 LTS.
It is not possible to install the Matlab connector (2025.11.0.2). The process is terminated and the following error is thrown:
Gtk-Message: 11:08:08.425: Failed to load module "gail"
Gtk-Message: 11:08:08.425: Failed to load module "atk-bridge"
I have never had any issues with the Connector whatsoever in the past. Following suggestions from the helpdesk, I did several things already: installing from a different folder, bypassing the firewall, disabling the router, install but not as superuser, fresh Matlab install, etc. It seems the installer completes extraction but fails to start services.
I am very much dependent on the Connector and it is very frustrating that 2025b & Connector do not work out-of-the-box. Furthermore, the process of troubleshooting has become beyond my expertise. What steps can I take to make it work? Is there a way to generate a log or something that can be used to understand the issue? I have installed the latest version of 2025b on a Linux system with Ubuntu 24.04.2 LTS.
It is not possible to install the Matlab connector (2025.11.0.2). The process is terminated and the following error is thrown:
Gtk-Message: 11:08:08.425: Failed to load module "gail"
Gtk-Message: 11:08:08.425: Failed to load module "atk-bridge"
I have never had any issues with the Connector whatsoever in the past. Following suggestions from the helpdesk, I did several things already: installing from a different folder, bypassing the firewall, disabling the router, install but not as superuser, fresh Matlab install, etc. It seems the installer completes extraction but fails to start services.
I am very much dependent on the Connector and it is very frustrating that 2025b & Connector do not work out-of-the-box. Furthermore, the process of troubleshooting has become beyond my expertise. What steps can I take to make it work? Is there a way to generate a log or something that can be used to understand the issue? matlab connector MATLAB Answers — New Questions
Simulink model freezes at 8% during compilation showing “updating library links blocks: started” in MATLAB 2024a
I am using MATLAB R2024a on Windows, and I am experiencing a consistent issue with one specific Simulink model. During simulation or code generation, the process freezes at 8% during compilation, showing the message “Updating library links blocks: started” in the lower left corner of the window. It remains stuck indefinitely at that stage.
Even if I try to cancel the build, MATLAB becomes unresponsive and eventually crashes, requiring a full restart. This happens almost every day, usually when reopening or restarting the model.
As a temporary workaround, I have been deleting the slprj folder and the .autosave file, and then running the command clear classes. After that, the model compiles normally again — but the issue reappears later.
This model uses several toolboxes, including:
Aerospace Blockset
Aerospace Toolbox
UAV Toolbox
Simulink, Simulink Coder, MATLAB core toolboxes.
The model does not use model references or custom libraries.
Has anyone experienced a similar freeze during “updating library links blocks”? Is there a more permanent fix or diagnostic step to prevent this issue?I am using MATLAB R2024a on Windows, and I am experiencing a consistent issue with one specific Simulink model. During simulation or code generation, the process freezes at 8% during compilation, showing the message “Updating library links blocks: started” in the lower left corner of the window. It remains stuck indefinitely at that stage.
Even if I try to cancel the build, MATLAB becomes unresponsive and eventually crashes, requiring a full restart. This happens almost every day, usually when reopening or restarting the model.
As a temporary workaround, I have been deleting the slprj folder and the .autosave file, and then running the command clear classes. After that, the model compiles normally again — but the issue reappears later.
This model uses several toolboxes, including:
Aerospace Blockset
Aerospace Toolbox
UAV Toolbox
Simulink, Simulink Coder, MATLAB core toolboxes.
The model does not use model references or custom libraries.
Has anyone experienced a similar freeze during “updating library links blocks”? Is there a more permanent fix or diagnostic step to prevent this issue? I am using MATLAB R2024a on Windows, and I am experiencing a consistent issue with one specific Simulink model. During simulation or code generation, the process freezes at 8% during compilation, showing the message “Updating library links blocks: started” in the lower left corner of the window. It remains stuck indefinitely at that stage.
Even if I try to cancel the build, MATLAB becomes unresponsive and eventually crashes, requiring a full restart. This happens almost every day, usually when reopening or restarting the model.
As a temporary workaround, I have been deleting the slprj folder and the .autosave file, and then running the command clear classes. After that, the model compiles normally again — but the issue reappears later.
This model uses several toolboxes, including:
Aerospace Blockset
Aerospace Toolbox
UAV Toolbox
Simulink, Simulink Coder, MATLAB core toolboxes.
The model does not use model references or custom libraries.
Has anyone experienced a similar freeze during “updating library links blocks”? Is there a more permanent fix or diagnostic step to prevent this issue? simulink, compilation, freeze, library-links, matlab2024a MATLAB Answers — New Questions
How to color-code columns in MATLAB Clustergram?
I am trying to label specific columns in a MATLAB clustergram with particular colors to indicate similarities between columns but not necessarily within dendogram clusters (I already have the clustergram made, just trying to better explain my data). I am aware of the ColumnGroupMarker function, but I do not want them based on cluster – I’d like to be able to control whether columns in the same group have different colors, similar to this academic paper has the bars for liver/lung and metastatic/normal:I am trying to label specific columns in a MATLAB clustergram with particular colors to indicate similarities between columns but not necessarily within dendogram clusters (I already have the clustergram made, just trying to better explain my data). I am aware of the ColumnGroupMarker function, but I do not want them based on cluster – I’d like to be able to control whether columns in the same group have different colors, similar to this academic paper has the bars for liver/lung and metastatic/normal: I am trying to label specific columns in a MATLAB clustergram with particular colors to indicate similarities between columns but not necessarily within dendogram clusters (I already have the clustergram made, just trying to better explain my data). I am aware of the ColumnGroupMarker function, but I do not want them based on cluster – I’d like to be able to control whether columns in the same group have different colors, similar to this academic paper has the bars for liver/lung and metastatic/normal: clustergram, plot MATLAB Answers — New Questions
in my simulink,used for voltage stabilization which used dvr in flc,here the output have some issues the vload and vinj? so can u help me, vload would be proper sine wave?
Post Content Post Content optimization, matlab, simulink MATLAB Answers — New Questions
Orifice (TL) temperature-dependent parameterization
Hello together,
I would like to specify an oil filter in Simscape. At the moment, I use the TL-Library orifice component for this task. I have test data available to specify the volumetric flow rate depending on the fluid temperature and the pressure drop. Unfortunately, I can’t find any option to make the orifice behave temperature-dependent. There is only an option to parameterize the volumetric flow rate vs. the pressure drop. If I do so, the model behaves the same for each temperature.
Does anybody know how I could model this component in an accurate way?
Thank you!Hello together,
I would like to specify an oil filter in Simscape. At the moment, I use the TL-Library orifice component for this task. I have test data available to specify the volumetric flow rate depending on the fluid temperature and the pressure drop. Unfortunately, I can’t find any option to make the orifice behave temperature-dependent. There is only an option to parameterize the volumetric flow rate vs. the pressure drop. If I do so, the model behaves the same for each temperature.
Does anybody know how I could model this component in an accurate way?
Thank you! Hello together,
I would like to specify an oil filter in Simscape. At the moment, I use the TL-Library orifice component for this task. I have test data available to specify the volumetric flow rate depending on the fluid temperature and the pressure drop. Unfortunately, I can’t find any option to make the orifice behave temperature-dependent. There is only an option to parameterize the volumetric flow rate vs. the pressure drop. If I do so, the model behaves the same for each temperature.
Does anybody know how I could model this component in an accurate way?
Thank you! simscape, orifice, hydraulic, model MATLAB Answers — New Questions
Simulink Scope Screen Cursors Disabled
I have a Simulink file that refuses to show the measurement tools on the scope. Note how the the time/value boxes are greyed out. Also, the ‘show panel’ does not work. I have other Simulink files where this is working just fine. I tried to delete and insert the scope again, but that did not help. I can’t find this mentioned anywhere in Help or Support. I can run the Screen cursors in another Simulink file in the same session, so it is something in this configuration.I have a Simulink file that refuses to show the measurement tools on the scope. Note how the the time/value boxes are greyed out. Also, the ‘show panel’ does not work. I have other Simulink files where this is working just fine. I tried to delete and insert the scope again, but that did not help. I can’t find this mentioned anywhere in Help or Support. I can run the Screen cursors in another Simulink file in the same session, so it is something in this configuration. I have a Simulink file that refuses to show the measurement tools on the scope. Note how the the time/value boxes are greyed out. Also, the ‘show panel’ does not work. I have other Simulink files where this is working just fine. I tried to delete and insert the scope again, but that did not help. I can’t find this mentioned anywhere in Help or Support. I can run the Screen cursors in another Simulink file in the same session, so it is something in this configuration. simulink, screen cursors MATLAB Answers — New Questions
How can I acquire images from multiple GigE cameras using Image Acquisition Toolbox and Parallel Computing Toolbox?
I have two or more GigE Vision cameras and I want to acquire images/video from them by using Parallel Computing Toolbox with one worker per camera.
Is there some example code that shows this approach?I have two or more GigE Vision cameras and I want to acquire images/video from them by using Parallel Computing Toolbox with one worker per camera.
Is there some example code that shows this approach? I have two or more GigE Vision cameras and I want to acquire images/video from them by using Parallel Computing Toolbox with one worker per camera.
Is there some example code that shows this approach? MATLAB Answers — New Questions
How do I plot a graph with the grid for trig functions with 0 ≤ x ≤ 2π
y1 = cos (x) … solid line, red, no marker
y2 = -sin (x) … dashed line, blue, no marker
y3 = cos (x)’ … no line, blue, circle
Cos(x)’ is the ferivative of cos(x)y1 = cos (x) … solid line, red, no marker
y2 = -sin (x) … dashed line, blue, no marker
y3 = cos (x)’ … no line, blue, circle
Cos(x)’ is the ferivative of cos(x) y1 = cos (x) … solid line, red, no marker
y2 = -sin (x) … dashed line, blue, no marker
y3 = cos (x)’ … no line, blue, circle
Cos(x)’ is the ferivative of cos(x) plotting, graph, functions MATLAB Answers — New Questions
Typo in Bicycle Kinematics/Steering Angle Equation?
Hi everyone,
Is there a typo in the documentation of Mobile Robot Kinematics -> Bicycle Kinematics -> Steering Angle Equation? See
https://uk.mathworks.com/help/robotics/ug/mobile-robot-kinematics-equations.html
The current model reads
However, I think the correct model should be
Am I missing something?Hi everyone,
Is there a typo in the documentation of Mobile Robot Kinematics -> Bicycle Kinematics -> Steering Angle Equation? See
https://uk.mathworks.com/help/robotics/ug/mobile-robot-kinematics-equations.html
The current model reads
However, I think the correct model should be
Am I missing something? Hi everyone,
Is there a typo in the documentation of Mobile Robot Kinematics -> Bicycle Kinematics -> Steering Angle Equation? See
https://uk.mathworks.com/help/robotics/ug/mobile-robot-kinematics-equations.html
The current model reads
However, I think the correct model should be
Am I missing something? steering angle equation, bicycle kinematics MATLAB Answers — New Questions
How to modify the engine model to be like my real 3 cylinder car, I’m trying to model the electrical system of my car but the start current is not the same.
I have the model and im trying to modify it so the start current is the same as my real 3 cylinder 1l car, im an electric eng student but i dont really know much mechanics for it to me to know how to mimic my real car, i also need the starter not engage when volatge is low, but some how it still moves, or at least the rpms do, i need to iddle at the same rpm and i have been able to increse the iddle but its still lower than 1000 (tho that might be due to electrical loads like lights ans stuff).I have the model and im trying to modify it so the start current is the same as my real 3 cylinder 1l car, im an electric eng student but i dont really know much mechanics for it to me to know how to mimic my real car, i also need the starter not engage when volatge is low, but some how it still moves, or at least the rpms do, i need to iddle at the same rpm and i have been able to increse the iddle but its still lower than 1000 (tho that might be due to electrical loads like lights ans stuff). I have the model and im trying to modify it so the start current is the same as my real 3 cylinder 1l car, im an electric eng student but i dont really know much mechanics for it to me to know how to mimic my real car, i also need the starter not engage when volatge is low, but some how it still moves, or at least the rpms do, i need to iddle at the same rpm and i have been able to increse the iddle but its still lower than 1000 (tho that might be due to electrical loads like lights ans stuff). start current, start motor, start system control MATLAB Answers — New Questions
Why i am getting different outputs when i am using Transfer function block(1/s) instead of integrator block in this block diagram. (2026a version).
Why am I getting different outputs when I use Transfer Function block (1/s) instead of Integrator block in this block diagram (Simulink 2026a version)? initial condition or saturation are not used.Why am I getting different outputs when I use Transfer Function block (1/s) instead of Integrator block in this block diagram (Simulink 2026a version)? initial condition or saturation are not used. Why am I getting different outputs when I use Transfer Function block (1/s) instead of Integrator block in this block diagram (Simulink 2026a version)? initial condition or saturation are not used. transferred MATLAB Answers — New Questions
How can I properly extract the features of a ferning pattern using image processing?
Using feature extraction, what can I do to distinguish the ferning pattern in a positive fern test? Attached is a sample image from https://commons.wikimedia.org/wiki/File:Positive_Fern_Test_.jpg .Using feature extraction, what can I do to distinguish the ferning pattern in a positive fern test? Attached is a sample image from https://commons.wikimedia.org/wiki/File:Positive_Fern_Test_.jpg . Using feature extraction, what can I do to distinguish the ferning pattern in a positive fern test? Attached is a sample image from https://commons.wikimedia.org/wiki/File:Positive_Fern_Test_.jpg . image processing, feature extraction, deep learning, classification MATLAB Answers — New Questions
Iterative of Nonlinear Functions
Someone please help, whenever i run my code I keep getting the same errors. My code and a screenshoot of the error page is attached.
% Given Values
k = 120;
alpha = 3.91e-6;
Ti=1073.15;
Tw=288.15;
Ta=288.15;
hw=100;
ha=10;
dt=10;
n_steps=60;
l=0.1;
tau=0.00391;
T1=zeros(n_steps,1);
T1(1,1)=Ti;
T2=zeros(n_steps,1);
T2(1,1)=Ti;
T3=zeros(n_steps,1);
T3(1,1)=Ti;
T4=zeros(n_steps,1);
T4(1,1)=Ti;
T5=zeros(n_steps,1);
T5(1,1)=Ti;
T6=zeros(n_steps,1);
T6(1,1)=Ti;
T7=zeros(n_steps,1);
T7(1,1)=Ti;
T8=zeros(n_steps,1);
T8(1,1)=Ti;
T9=zeros(n_steps,1);
T9(1,1)=Ti;
T10=zeros(n_steps,1);
T10(1,1)=Ti;
T11=zeros(n_steps,1);
T11(1,1)=Ti;
T12=zeros(n_steps,1);
T12(1,1)=Ti;
T13=zeros(n_steps,1);
T13(1,1)=Ti;
T14=zeros(n_steps,1);
T14(1,1)=Ti;
T15=zeros(n_steps,1);
T15(1,1)=Ti;
for i=1:(n_steps-1)
syms t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15
eqn1 = l*k*(ha+hw)*(Ta-T1(i))+(T6-T1(i))+(T2(i)-T1(i))==(t1-T1(i))/tau;
eqn2 = ha*l*(Ta-T2(i)+((T7(i)-T2(i))+(T3(i)-T2(i))+(T1(i)-T2(i))))==(t2-T2(i))/tau;
eqn3 = ha*l/k*(Ta-T3(i))+((T4(i)-T3(i))+(T8(i)-T3(i)+(T2(i)-T3(i))))==(t3-T1(i))/tau;
eqn4 = ha*l*(Ta-T4(i)+((T9(i)-T4(i))+(T3(i)-T4(i))+(T5(i)-T4(i))))==(t4-T4(i))/tau;
eqn5 = l*k*(ha+hw)*(Ta-T5(i))+(T10-T5(i))+(T4(i)-T5(i))==(t5-T5(i))/tau;
eqn6 = hw*l/k*(Ta-T6(i))+((T1(i)-T6(i))+(T7(i)-T6(i))+(T11(i)-T6(i)))==(t6-T6(i))/tau;
eqn7 = (T6(i)-T7(i))+(T8(i)-T7(i))+(T2(i)-T7(i))+(T12(i)-T7(i))==(t7-T7(i))/tau;
eqn8 = (T7(i)-T8(i))+(T9(i)-T8(i))+(T3(i)-T8(i))+(T13(i)-T8(i))==(t8-T8(i))/tau;
eqn9 = (T8(i)-T9(i))+(T10(i)-T9(i))+(T4(i)-T9(i))+(T14(i)-T9(i))==(t9-T9(i))/tau;
eqn10 = hw*l/k*(Ta-T10(i))+((T5(i)-T10(i))+(T9(i)-T10(i))+(T15(i)-T10(i)))==(t10-T10(i))/tau;
eqn11 = hw*l/k*(Ta-T11(i))+((T6(i)-T11(i))+(T12(i)-T11(i)))==(t11-T11(i))/tau;
eqn12 = hw*l/k*(Ta-T12(i))+((T13(i)-T12(i)+(T7(i)-T12(i))+(T11(i)-T12(i))))==(t12-T12(i))/tau;
eqn13 = hw*l/k*(Ta-T13(i))+((T12(i)-T13(i)+(T8(i)-T13(i))+(T14(i)-T13(i))))==(t13-T13(i))/tau;
eqn14 = hw*l/k*(Ta-T14(i))+((T13(i)-T14(i)+(T5(i)-T14(i))+(T9(i)-T14(i))))==(t14-T14(i))/tau;
eqn15 = hw*l/k*(Ta-T15(i))+((T14(i)-T15(i))+(T10(i)-T15(i)))==(t15-T15(i))/tau;
s = solve([eqn1 eqn2 eqn3 eqn4 eqn5 eqn6 eqn7 eqn8 eqn9 eqn10 eqn11 eqn12 eqn13 eqn14 eqn15],…
[t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15]);
nodal_temperatures = double(struct2array(s));
T1(i+1,1) = s(1);
T2(i+1,1) = s(2);
T3(i+1,1) = s(3);
T4(i+1,1) = s(4);
T5(i+1,1) = s(5);
T6(i+1,1) = s(6);
T7(i+1,1) = s(7);
T8(i+1,1) = s(8);
T9(i+1,1) = s(9);
T10(i+1,1) = s(10);
T11(i+1,1) = s(11);
T12(i+1,1) = s(12);
T13(i+1,1) = s(13);
T14(i+1,1) = s(14);
T15(i+1,1) = s(15);
end
% Display the results for the final temperatures
disp(‘Final Temperatures at Step 60:’);
disp([T1(60,1), T2(60,1), T3(60,1), T4(60,1), T5(60,1), T6(60,1), …
T7(60,1), T8(60,1), T9(60,1), T10(60,1), T11(60,1), T12(60,1),…
T13(60,1), T14(60,1), T15(60,1)]);Someone please help, whenever i run my code I keep getting the same errors. My code and a screenshoot of the error page is attached.
% Given Values
k = 120;
alpha = 3.91e-6;
Ti=1073.15;
Tw=288.15;
Ta=288.15;
hw=100;
ha=10;
dt=10;
n_steps=60;
l=0.1;
tau=0.00391;
T1=zeros(n_steps,1);
T1(1,1)=Ti;
T2=zeros(n_steps,1);
T2(1,1)=Ti;
T3=zeros(n_steps,1);
T3(1,1)=Ti;
T4=zeros(n_steps,1);
T4(1,1)=Ti;
T5=zeros(n_steps,1);
T5(1,1)=Ti;
T6=zeros(n_steps,1);
T6(1,1)=Ti;
T7=zeros(n_steps,1);
T7(1,1)=Ti;
T8=zeros(n_steps,1);
T8(1,1)=Ti;
T9=zeros(n_steps,1);
T9(1,1)=Ti;
T10=zeros(n_steps,1);
T10(1,1)=Ti;
T11=zeros(n_steps,1);
T11(1,1)=Ti;
T12=zeros(n_steps,1);
T12(1,1)=Ti;
T13=zeros(n_steps,1);
T13(1,1)=Ti;
T14=zeros(n_steps,1);
T14(1,1)=Ti;
T15=zeros(n_steps,1);
T15(1,1)=Ti;
for i=1:(n_steps-1)
syms t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15
eqn1 = l*k*(ha+hw)*(Ta-T1(i))+(T6-T1(i))+(T2(i)-T1(i))==(t1-T1(i))/tau;
eqn2 = ha*l*(Ta-T2(i)+((T7(i)-T2(i))+(T3(i)-T2(i))+(T1(i)-T2(i))))==(t2-T2(i))/tau;
eqn3 = ha*l/k*(Ta-T3(i))+((T4(i)-T3(i))+(T8(i)-T3(i)+(T2(i)-T3(i))))==(t3-T1(i))/tau;
eqn4 = ha*l*(Ta-T4(i)+((T9(i)-T4(i))+(T3(i)-T4(i))+(T5(i)-T4(i))))==(t4-T4(i))/tau;
eqn5 = l*k*(ha+hw)*(Ta-T5(i))+(T10-T5(i))+(T4(i)-T5(i))==(t5-T5(i))/tau;
eqn6 = hw*l/k*(Ta-T6(i))+((T1(i)-T6(i))+(T7(i)-T6(i))+(T11(i)-T6(i)))==(t6-T6(i))/tau;
eqn7 = (T6(i)-T7(i))+(T8(i)-T7(i))+(T2(i)-T7(i))+(T12(i)-T7(i))==(t7-T7(i))/tau;
eqn8 = (T7(i)-T8(i))+(T9(i)-T8(i))+(T3(i)-T8(i))+(T13(i)-T8(i))==(t8-T8(i))/tau;
eqn9 = (T8(i)-T9(i))+(T10(i)-T9(i))+(T4(i)-T9(i))+(T14(i)-T9(i))==(t9-T9(i))/tau;
eqn10 = hw*l/k*(Ta-T10(i))+((T5(i)-T10(i))+(T9(i)-T10(i))+(T15(i)-T10(i)))==(t10-T10(i))/tau;
eqn11 = hw*l/k*(Ta-T11(i))+((T6(i)-T11(i))+(T12(i)-T11(i)))==(t11-T11(i))/tau;
eqn12 = hw*l/k*(Ta-T12(i))+((T13(i)-T12(i)+(T7(i)-T12(i))+(T11(i)-T12(i))))==(t12-T12(i))/tau;
eqn13 = hw*l/k*(Ta-T13(i))+((T12(i)-T13(i)+(T8(i)-T13(i))+(T14(i)-T13(i))))==(t13-T13(i))/tau;
eqn14 = hw*l/k*(Ta-T14(i))+((T13(i)-T14(i)+(T5(i)-T14(i))+(T9(i)-T14(i))))==(t14-T14(i))/tau;
eqn15 = hw*l/k*(Ta-T15(i))+((T14(i)-T15(i))+(T10(i)-T15(i)))==(t15-T15(i))/tau;
s = solve([eqn1 eqn2 eqn3 eqn4 eqn5 eqn6 eqn7 eqn8 eqn9 eqn10 eqn11 eqn12 eqn13 eqn14 eqn15],…
[t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15]);
nodal_temperatures = double(struct2array(s));
T1(i+1,1) = s(1);
T2(i+1,1) = s(2);
T3(i+1,1) = s(3);
T4(i+1,1) = s(4);
T5(i+1,1) = s(5);
T6(i+1,1) = s(6);
T7(i+1,1) = s(7);
T8(i+1,1) = s(8);
T9(i+1,1) = s(9);
T10(i+1,1) = s(10);
T11(i+1,1) = s(11);
T12(i+1,1) = s(12);
T13(i+1,1) = s(13);
T14(i+1,1) = s(14);
T15(i+1,1) = s(15);
end
% Display the results for the final temperatures
disp(‘Final Temperatures at Step 60:’);
disp([T1(60,1), T2(60,1), T3(60,1), T4(60,1), T5(60,1), T6(60,1), …
T7(60,1), T8(60,1), T9(60,1), T10(60,1), T11(60,1), T12(60,1),…
T13(60,1), T14(60,1), T15(60,1)]); Someone please help, whenever i run my code I keep getting the same errors. My code and a screenshoot of the error page is attached.
% Given Values
k = 120;
alpha = 3.91e-6;
Ti=1073.15;
Tw=288.15;
Ta=288.15;
hw=100;
ha=10;
dt=10;
n_steps=60;
l=0.1;
tau=0.00391;
T1=zeros(n_steps,1);
T1(1,1)=Ti;
T2=zeros(n_steps,1);
T2(1,1)=Ti;
T3=zeros(n_steps,1);
T3(1,1)=Ti;
T4=zeros(n_steps,1);
T4(1,1)=Ti;
T5=zeros(n_steps,1);
T5(1,1)=Ti;
T6=zeros(n_steps,1);
T6(1,1)=Ti;
T7=zeros(n_steps,1);
T7(1,1)=Ti;
T8=zeros(n_steps,1);
T8(1,1)=Ti;
T9=zeros(n_steps,1);
T9(1,1)=Ti;
T10=zeros(n_steps,1);
T10(1,1)=Ti;
T11=zeros(n_steps,1);
T11(1,1)=Ti;
T12=zeros(n_steps,1);
T12(1,1)=Ti;
T13=zeros(n_steps,1);
T13(1,1)=Ti;
T14=zeros(n_steps,1);
T14(1,1)=Ti;
T15=zeros(n_steps,1);
T15(1,1)=Ti;
for i=1:(n_steps-1)
syms t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15
eqn1 = l*k*(ha+hw)*(Ta-T1(i))+(T6-T1(i))+(T2(i)-T1(i))==(t1-T1(i))/tau;
eqn2 = ha*l*(Ta-T2(i)+((T7(i)-T2(i))+(T3(i)-T2(i))+(T1(i)-T2(i))))==(t2-T2(i))/tau;
eqn3 = ha*l/k*(Ta-T3(i))+((T4(i)-T3(i))+(T8(i)-T3(i)+(T2(i)-T3(i))))==(t3-T1(i))/tau;
eqn4 = ha*l*(Ta-T4(i)+((T9(i)-T4(i))+(T3(i)-T4(i))+(T5(i)-T4(i))))==(t4-T4(i))/tau;
eqn5 = l*k*(ha+hw)*(Ta-T5(i))+(T10-T5(i))+(T4(i)-T5(i))==(t5-T5(i))/tau;
eqn6 = hw*l/k*(Ta-T6(i))+((T1(i)-T6(i))+(T7(i)-T6(i))+(T11(i)-T6(i)))==(t6-T6(i))/tau;
eqn7 = (T6(i)-T7(i))+(T8(i)-T7(i))+(T2(i)-T7(i))+(T12(i)-T7(i))==(t7-T7(i))/tau;
eqn8 = (T7(i)-T8(i))+(T9(i)-T8(i))+(T3(i)-T8(i))+(T13(i)-T8(i))==(t8-T8(i))/tau;
eqn9 = (T8(i)-T9(i))+(T10(i)-T9(i))+(T4(i)-T9(i))+(T14(i)-T9(i))==(t9-T9(i))/tau;
eqn10 = hw*l/k*(Ta-T10(i))+((T5(i)-T10(i))+(T9(i)-T10(i))+(T15(i)-T10(i)))==(t10-T10(i))/tau;
eqn11 = hw*l/k*(Ta-T11(i))+((T6(i)-T11(i))+(T12(i)-T11(i)))==(t11-T11(i))/tau;
eqn12 = hw*l/k*(Ta-T12(i))+((T13(i)-T12(i)+(T7(i)-T12(i))+(T11(i)-T12(i))))==(t12-T12(i))/tau;
eqn13 = hw*l/k*(Ta-T13(i))+((T12(i)-T13(i)+(T8(i)-T13(i))+(T14(i)-T13(i))))==(t13-T13(i))/tau;
eqn14 = hw*l/k*(Ta-T14(i))+((T13(i)-T14(i)+(T5(i)-T14(i))+(T9(i)-T14(i))))==(t14-T14(i))/tau;
eqn15 = hw*l/k*(Ta-T15(i))+((T14(i)-T15(i))+(T10(i)-T15(i)))==(t15-T15(i))/tau;
s = solve([eqn1 eqn2 eqn3 eqn4 eqn5 eqn6 eqn7 eqn8 eqn9 eqn10 eqn11 eqn12 eqn13 eqn14 eqn15],…
[t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15]);
nodal_temperatures = double(struct2array(s));
T1(i+1,1) = s(1);
T2(i+1,1) = s(2);
T3(i+1,1) = s(3);
T4(i+1,1) = s(4);
T5(i+1,1) = s(5);
T6(i+1,1) = s(6);
T7(i+1,1) = s(7);
T8(i+1,1) = s(8);
T9(i+1,1) = s(9);
T10(i+1,1) = s(10);
T11(i+1,1) = s(11);
T12(i+1,1) = s(12);
T13(i+1,1) = s(13);
T14(i+1,1) = s(14);
T15(i+1,1) = s(15);
end
% Display the results for the final temperatures
disp(‘Final Temperatures at Step 60:’);
disp([T1(60,1), T2(60,1), T3(60,1), T4(60,1), T5(60,1), T6(60,1), …
T7(60,1), T8(60,1), T9(60,1), T10(60,1), T11(60,1), T12(60,1),…
T13(60,1), T14(60,1), T15(60,1)]); for loop, iteration, nonlinear, multiple, iteration equation, simulation, mathematics MATLAB Answers — New Questions
Error trying to get started with get_chanlocs plugin for EEGLAB “Unrecognized function or variable ‘placeFiducials'”
Hello,
I am very new to MATLAB, so apologies in advance if this is a trivial question. My university has recently acquired a Structure Sensor 3 scanner, and we would like to use the 3D models to conduct source localisation. It looks like get_chanlocs is the perfect tool to get the locations of the channels on the 3D models, but I am running into issues when trying to open the models in EEGLAB.
After importing my EEG data (.bdf file, from a Biosemi system, 64 channels), I use the "Locate electrodes in a 3D head image" option. First, I am prompted to select my 3D model, where I choose the .obj file created with the 3D scanner. Then I am asked if I want to use a template; since I do not have one yet, I select "No, I will select locations in order". At this point, MATLAB gives me this error:
Unrecognized function or variable ‘placeFiducials’.
Error in get_chanlocs (line 177)
fiducials = placeFiducials(head_surface);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think it means there is a function (placeFiducials) that the script is trying to use, but cannot find. But I am not sure where this function should be located. Am I missing a plugin, or could this be an issue with version compatibility?
I am currently using:
– MATLAB R2025b
– EEGLAB 2025.1.0
– FieldTrip 20250106
Installed EEGLAB plugins:
– Biosig v3.8.4
– ERPLAB v12.10
– clean_rawdata v2.11
– ICLabel v1.7
– firfilt v2.8
– dipfit v5.6
– EEG-BIDS v10.3
– get_chanlocs v4
– NFT v2.2
Thanks in advance if anyone can help me with this.Hello,
I am very new to MATLAB, so apologies in advance if this is a trivial question. My university has recently acquired a Structure Sensor 3 scanner, and we would like to use the 3D models to conduct source localisation. It looks like get_chanlocs is the perfect tool to get the locations of the channels on the 3D models, but I am running into issues when trying to open the models in EEGLAB.
After importing my EEG data (.bdf file, from a Biosemi system, 64 channels), I use the "Locate electrodes in a 3D head image" option. First, I am prompted to select my 3D model, where I choose the .obj file created with the 3D scanner. Then I am asked if I want to use a template; since I do not have one yet, I select "No, I will select locations in order". At this point, MATLAB gives me this error:
Unrecognized function or variable ‘placeFiducials’.
Error in get_chanlocs (line 177)
fiducials = placeFiducials(head_surface);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think it means there is a function (placeFiducials) that the script is trying to use, but cannot find. But I am not sure where this function should be located. Am I missing a plugin, or could this be an issue with version compatibility?
I am currently using:
– MATLAB R2025b
– EEGLAB 2025.1.0
– FieldTrip 20250106
Installed EEGLAB plugins:
– Biosig v3.8.4
– ERPLAB v12.10
– clean_rawdata v2.11
– ICLabel v1.7
– firfilt v2.8
– dipfit v5.6
– EEG-BIDS v10.3
– get_chanlocs v4
– NFT v2.2
Thanks in advance if anyone can help me with this. Hello,
I am very new to MATLAB, so apologies in advance if this is a trivial question. My university has recently acquired a Structure Sensor 3 scanner, and we would like to use the 3D models to conduct source localisation. It looks like get_chanlocs is the perfect tool to get the locations of the channels on the 3D models, but I am running into issues when trying to open the models in EEGLAB.
After importing my EEG data (.bdf file, from a Biosemi system, 64 channels), I use the "Locate electrodes in a 3D head image" option. First, I am prompted to select my 3D model, where I choose the .obj file created with the 3D scanner. Then I am asked if I want to use a template; since I do not have one yet, I select "No, I will select locations in order". At this point, MATLAB gives me this error:
Unrecognized function or variable ‘placeFiducials’.
Error in get_chanlocs (line 177)
fiducials = placeFiducials(head_surface);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think it means there is a function (placeFiducials) that the script is trying to use, but cannot find. But I am not sure where this function should be located. Am I missing a plugin, or could this be an issue with version compatibility?
I am currently using:
– MATLAB R2025b
– EEGLAB 2025.1.0
– FieldTrip 20250106
Installed EEGLAB plugins:
– Biosig v3.8.4
– ERPLAB v12.10
– clean_rawdata v2.11
– ICLabel v1.7
– firfilt v2.8
– dipfit v5.6
– EEG-BIDS v10.3
– get_chanlocs v4
– NFT v2.2
Thanks in advance if anyone can help me with this. get_chanlocs, eeglab, error: placefiducials MATLAB Answers — New Questions
Help me to run the code
% Creating variables
aSca = 2.5 * 1023;
bSca = 4 + 2i;
cVect = (6:-0.6:-5)’;
dMat = diag(2*ones(4,1));
eMat = randi([-2 2],4,3);
% Common functions and indexing
fSum = sum(eMat);
dMat(:,3) = 1;
gSub = eMat(1:3,1:2);
dMat(:,end) = [];
shaimaa_Al_Otaibi_Computer_Engineering = [dMat eMat];
shaimaa_Al_Otaibi_Computer_Engineering = round(shaimaa_Al_Otaibi_Computer_Engineering);
fMat = 5:10;
% Control statements
% a)
xVec = 0:0.1:2;
% b)
sum_n = 0;
n = 0;
while sum_n <= 500
n = n + 1;
sum_n = sum_n + n;
end
% c)
if aSca > bSca
disp(‘aSca is greater than bSca.’)
else
disp(‘bSca is greater than aSca.’)
end
% d)
x = 3;
switch x
case 1
disp(‘x is 1.’)
case 2
disp(‘x is 2.’)
case {3,4}
disp(‘x is 3 or 4.’)
otherwise
disp(‘x is not 1, 2, 3, or 4.’)
end% Creating variables
aSca = 2.5 * 1023;
bSca = 4 + 2i;
cVect = (6:-0.6:-5)’;
dMat = diag(2*ones(4,1));
eMat = randi([-2 2],4,3);
% Common functions and indexing
fSum = sum(eMat);
dMat(:,3) = 1;
gSub = eMat(1:3,1:2);
dMat(:,end) = [];
shaimaa_Al_Otaibi_Computer_Engineering = [dMat eMat];
shaimaa_Al_Otaibi_Computer_Engineering = round(shaimaa_Al_Otaibi_Computer_Engineering);
fMat = 5:10;
% Control statements
% a)
xVec = 0:0.1:2;
% b)
sum_n = 0;
n = 0;
while sum_n <= 500
n = n + 1;
sum_n = sum_n + n;
end
% c)
if aSca > bSca
disp(‘aSca is greater than bSca.’)
else
disp(‘bSca is greater than aSca.’)
end
% d)
x = 3;
switch x
case 1
disp(‘x is 1.’)
case 2
disp(‘x is 2.’)
case {3,4}
disp(‘x is 3 or 4.’)
otherwise
disp(‘x is not 1, 2, 3, or 4.’)
end % Creating variables
aSca = 2.5 * 1023;
bSca = 4 + 2i;
cVect = (6:-0.6:-5)’;
dMat = diag(2*ones(4,1));
eMat = randi([-2 2],4,3);
% Common functions and indexing
fSum = sum(eMat);
dMat(:,3) = 1;
gSub = eMat(1:3,1:2);
dMat(:,end) = [];
shaimaa_Al_Otaibi_Computer_Engineering = [dMat eMat];
shaimaa_Al_Otaibi_Computer_Engineering = round(shaimaa_Al_Otaibi_Computer_Engineering);
fMat = 5:10;
% Control statements
% a)
xVec = 0:0.1:2;
% b)
sum_n = 0;
n = 0;
while sum_n <= 500
n = n + 1;
sum_n = sum_n + n;
end
% c)
if aSca > bSca
disp(‘aSca is greater than bSca.’)
else
disp(‘bSca is greater than aSca.’)
end
% d)
x = 3;
switch x
case 1
disp(‘x is 1.’)
case 2
disp(‘x is 2.’)
case {3,4}
disp(‘x is 3 or 4.’)
otherwise
disp(‘x is not 1, 2, 3, or 4.’)
end matrix MATLAB Answers — New Questions









