Q121
Q121 Which block in Simulink is used to integrate a signal?
Integrator block
Scope block
Gain block
Sum block
Q122
Q122 What is the role of the "Scope" block in Simulink?
Visualizing signals
Integrating signals
Multiplying signals
Differentiating signals
Q123
Q123 Which block is used to generate a sine wave in Simulink?
Sine Wave block
Signal Generator block
Scope block
Constant block
Q124
Q124 How do you open a new Simulink model from the MATLAB Command Window?
simulink
open_system
new_model
start_simulink
Q125
Q125 Write a MATLAB command to set the simulation stop time to 10 seconds in Simulink.
set_param('model', 'StopTime', '10')
simset('StopTime', '10')
set_time('model', '10')
set_stop_time('model', '10')
Q126
Q126 Write a MATLAB code snippet to programmatically add a Gain block to a Simulink model.
add_block('simulink/Commonly Used Blocks/Gain', 'model/Gain')
add('Gain', 'model')
add_gain('model')
add_block('Gain', 'model')
Q127
Q127 Why does "Unable to find block" error occur in Simulink?
Block name is incorrect
Model is not loaded
Block is deleted
All of the above
Q128
Q128 Why does "Solver configuration is missing" error occur in Simulink?
No solver specified for the model
Incorrect block connections
Missing block parameters
All of the above
Q129
Q129 What is the purpose of the "fit" function in MATLAB?
Fits a curve to data
Calculates the derivative
Generates random values
Solves linear equations
Q130
Q130 What is the role of the Optimization Toolbox?
Solves linear and nonlinear optimization problems
Generates plots
Processes images
Creates statistical models
Q131
Q131 Which MATLAB function is used for nonlinear curve fitting?
lsqcurvefit
polyfit
fitnlm
fminsearch
Q132
Q132 Write a MATLAB command to fit a polynomial of degree 2 to data x and y.
polyfit(x, y, 2)
fit(x, y, 2)
polycurve(x, y, 2)
polynomialfit(x, y, 2)
Q133
Q133 Write a MATLAB code snippet to perform linear optimization using "linprog".
linprog(f, A, b)
linopt(f, A, b)
optimize(f, A, b)
linearprog(f, A, b)
Q134
Q134 Write a MATLAB code to fit an exponential model to data using "fit".
fit(x, y, 'exp1')
fitexp(x, y)
exponentialfit(x, y)
fit(x, y, 'exponential')
Q135
Q135 Why does MATLAB throw "Matrix dimensions must agree" during optimization?
Mismatched input dimensions
Invalid constraints
Undefined variables
Incorrect syntax
Q136
Q136 Why does "Solver failed to converge" occur in optimization?
Poor initial guess
Incorrect model
Large dataset
All of the above
Q137
Q137 What is the purpose of the "persistent" keyword in MATLAB?
To retain variable values across function calls
To declare global variables
To define a constant
To create temporary variables
Q138
Q138 What is the difference between "parfor" and "for" loops in MATLAB?
"parfor" runs iterations in parallel, "for" runs sequentially
"parfor" runs sequentially, "for" runs in parallel
Both are identical
"for" is faster than "parfor"
Q139
Q139 Which function is used to profile the performance of MATLAB code?
profile
timing
measure
benchmark
Q140
Q140 Write a MATLAB command to create a handle to an anonymous function f(x) = x^2.
f = @(x) x^2
f = anonymous(x) x^2
f = function(x) x^2
f = handle(x) x^2
Q141
Q141 Write a MATLAB code snippet to create a custom class with a property and a method.
classdef MyClass, properties, Value, end, methods, function obj = set.Value(obj, val), obj.Value = val; end, end, end
class MyClass {int Value; method setValue();}
classdef MyClass(Value), end
class MyClass {methods Value}
Q142
Q142 Why does MATLAB throw "Undefined function for input arguments of type double"?
Function not defined for double input
Incorrect input type
Function is private
All of the above
Q143
Q143 Why does "Variable appears to change size on every loop iteration" warning occur?
Variable is dynamically resized
Variable is not initialized
Variable name conflict
Incorrect loop syntax
Q144
Q144 What is a common use case for MATLAB in engineering?
Simulation and analysis of control systems
Creating web applications
Processing financial transactions
Performing data entry
Q145
Q145 How is MATLAB used in image processing applications?
Enhancing images and extracting features
Performing financial analysis
Generating audio signals
Building web servers
Q146
Q146 What is the primary role of MATLAB in financial modeling?
Risk assessment and portfolio optimization
Generating statistical reports
Creating dashboards
Building data warehouses
Q147
Q147 Write a MATLAB code snippet to perform basic signal filtering.
filtered_signal = filter(b, a, input_signal);
filtered_signal = signal_filter(input_signal);
filtering(input_signal);
signal_process(input_signal);
Q148
Q148 Write a MATLAB code snippet to simulate a simple pendulum's motion.
theta = sin(omegat);
theta = Acos(omegat);
theta = Asin(omega*t); t = linspace(0, 10, 100); plot(t, theta);
theta = sin(t); plot(theta);
Q149
Q149 Why does "Matrix dimensions must agree" error occur in case studies?
Input dimensions are mismatched
Incorrect syntax
Undefined variables
All of the above
Q150
Q150 Why does "Singular matrix" error occur in MATLAB applications?
Determinant is zero
Incorrect matrix multiplication
Unsupported operation
All of the above