What is MATLAB Matrix Laboratory?
It is a programming platform designed to analyse and design systems and products Analyse data, develop algorithms,
Create models and applications.
MATLAB will take ideas from research to production by deploying to enterprise applications and embedded devices,
as well as integrating with Simulink and Model-Based Design.
What is Simulink?
The platform for Model-Based Design that supports system-level design, simulation, automatic code generation and continous test and verification all embedded systems. Simulink provides a graphical editor, customizable block libraries and solver for modeling and simulating dynamic systems.
Default Data type in MATLAB?
The default dala type in MATLAB is double-precision floating-point.
Diffrence between structure and array?
Structure is a collection that contain the dementsal, dissimilar datatypes. Array can contain the elements of same datatype.
Explain about Solver and Types at Solver?
In Simulink, a solver is an algorithm used to numerically, integrate the equations of a dynamic system during simulation.
1.Fixed-step solver
2.Variable-step solver
How to select a particular type of solver?
To select a particular type af solver in simulink, go to the solver settings in the Configuration parameters dialog box and choose the desired solver based on your simulation requirements.
What Fixed type solver?
It will solve the model at regular time intervals from the beginning to the end of
of the simulation. The size of the interval to known as the step size.
Generally, a smaller the stepsize increases the accuracy of the results but also increases time required to simulate the system.
What is the need of Fixed type solver?
In embedded systems, fixed-point representations are aften preferged over floating-point representations for several important reasons.
Resource Efficiency: fixed point is mone Jusource efficient because it doesn’t require the complex hardware nuded fan Hoating-point Operations
Reduced code size: Lower Power Consumption:
Compatibility: Some embedded processors may not have hardware support for floating-point operations, while fixed-point operations are typical available on a wide range af microcontrollers & processors.
Explain about workspace and Types of workspace?
In MATLAB, the workspace is a storage area where variables are created and stored during a session.
1.Base workspace
2.Function workspace
3.Global workspace.
What is a Data Dictionary?
DD in dimulink is a central supository to manage and organize design data such as parameters, dada types and variables, making it easier to share and resise infasimation acgross models.
Difference between .mdl and .slx file?
The .mdl extension is used for simulink models saved in the older binary format.
The .slx extension is used for models saved in the newer XML-based format.
Explain / Inherit via back propagation?
These are the settings in simulink for determining the data types af signals based on block connections and internal calculations, respectively.
Explain about Fixed point?
These are the settings in simulink for determining the data types af signals based on block connections and internal calculations, respectively.
Explain about Floating point?
Precision: Floating-point affers high precision and is suitable for modeling systems where numerical acuracy is crucial
Flexibility: It allows you to work with a wide range af values, both small and large.
Complexity: Modeling with floating-point can be Computationally expensive due to the need for higher processing power.
Applications: It is commonly used for controlsystems. signal processing and simulations where high precision A required.
What is Sample Time & step size?
Sample Time is the time between consecutive samples in a simulation.
Step size is the time interval used by numerical solvers to calculate system states.
What is simulation Time?
Simulation Time is the total time for which a simulation runs to analyze the dynamic behavior of a system.
What is meant by Dead Logic in a simulink model?
Dead logic in a dimulink model refers to logic on blocks that do not contsribute to the overall functionality al the system, making them unnecessary and potentially impacting simulation efficiency.
Diffrence between discrete and continous?
In Simulink, dicreate systems are those whose states change only at specific time instances, while continous system change continuusly over time.
What is a Plant model and Control Model?
Plant model is the mathematical model of the real system, that should have the required level of fidelity to simulate the desired behavior.
Control model is the model used to design the controller.
What are the diffrent types of subsystems you used?
In Simulink, Atomic subsystems, Function subsystems, Variant subsystems and Model Rifference subsystems.
Difference between Enable, Trigger & function subsystem?
Enable subsystem allows the signal to pass through when enabled.
Trigger subsystern executes once its triggered.
Function subrystem contains specific functionality a set af blocks performing specific functionality.
Explain Model Reference?
Model reference in simulink allows you to modularize a large model by referencing external models as subsystems, promoting model reusability and maintain ability.
Explain variant subsystem and where to use variant subsystem
Variant subsystem is used when multiple versions of a subsystem need to be switched during simulation, providing flexibility for diffuent configurations in a model.
Difference between Virtual and Non-Virtual subsystems?
Virtual subsystem provides graphical hierarchy in a model. (Execution order depends on blocks).
Non-Virtual subsystem provides graphical hierarchy and executes as a unit within a model (Execution order depends on subsystem).
Difference between Atomic and Non-Atomic subsystems?
Atomic subsystems we can control the execution of the model if forces simulink to run all the blocks in that subsystem as if it were its own separate function. This has implications for generated code as well. (dark border)
Non-Atomic subsystems are simply a visual convenience, but Simulink treats the subsystems as it all the blocks existed at the same level. (Virtual)
What is Function Packaging?
Function Packaging is a way to organize and package related functions into a function package, promoting code modularity and maintainability in simulink.
Scope of the Enable subsystem?
The enable subsystem controls the execution of blocks inside the subsystem based on the enabling condition, “making it useful for selective block execution.
How to choose an when do we need to use the Switch black and If Else subsystem?
Switch Block: When you have a condition to choose between two valus ar signals.
If-Else subsystem: When you have complex conditional logic requiring multiple branching conditions.
Difference between Model Reference and Custom Library?
Model Reference allows you to reuse a complete model as a subsystern.
Custom Library lets you create a custom set of blocks to be used across multiple models for code reuse and standardization.
Difference between switch and Multiport switch block?
Switch block: Selects between two inputs based on a control signal.
Multiport Switch block: delects between multiple inputs based on the control signal.
Difference between Mux and Demux block?
Mux block: Combines multiple input signals into one output signal.
Demux block: deparates a single input signal into multiple output signals.
Difference between Mux and Bus?
Mux: Combines multiple input sinagls into one output signal, Concatenate signals directly.
which is having same datatype signals. [Array]
Bus: A bus reprensents a set af elements. we can specify the bus object. which can have same or diffrent data types. [structure].
Bus Creater and Bus Selector?
Bus creator: Block combines a set af input elements into a bus you can connect any element types to the input ports, including other buses.
Bus selector: Block outputs the elements you select from the input bus. The block can output the selected elements separately.
What is the use of the Merge block?
The Merge block combines its inputs into a single output line whose value at any time is equal to the most recently computed output of its driving blocks.
Note: If we activate both inpults af, Merge block then ensure that the Menge block output is updated by only one af its input signals at wery time step.
Difference between Zero Order Hold, Delay & Rate transition block?
Zero-Order Hold maintains a constant value between samples.
Delay block introduces a time delay to a signal.
Rate transition block used to change the sample rate af, a signal.
What is the use of the From and Goto block?
The From and Goto blocks an wed for data transfer between differenet parts of a model without direct connections, enhancing readability and reducing signal clutter.
Explain about DSM, DSR and DSW?
DSM (Data Hare Memory) is used to starre dala globally in a model,
scope af DSM is can be accessed and modified across different parts of the model.
DSR (Data Stare Read) reads data from the DSM.
DSW (Date stare write) writes data into the DSM.
Diffrence between From/Goto block and DSR/DSW?
From/Goto blocks transfer data locally within the model.
DSR/DSW blocks access and modily global data stored in DSM.
What is Masking?
A mask is a custom user interface for a block. By masking a block you encapsulate the block diagram to have its own parameter dialog box with its own black description, parameter prompts.
Difference between Mask and Library blocks?
Mask blocks have customizable parameters.
Library blocks are predefined & cannot be directly modified.
What is the use of the Gain block?
The Gain block multiplies the input signals by a constant gain value,
Scaling the amplitude of the signal.
Diffference between Multiple and Product block?
Multiple block performs element-wise multiplication between two matrices.
Product block performs matrix multiplication.
Explain about LUT (Look-up Table)?
LUT (Look-up Table) block is used to map input values to specific output values.
It is useful for implementing complex matthematical. functions an data conversions
What is the use of Truth Table?
The Truth Table block provides a convenient way to define the output based on different combinations of input conditions, facilitating logic based operations.
What are the different types of errors in Simulink?
Algebraic Loop Error:
It occurs when a feedback Joop is farmed within simulink model, resulting in circular dependencies between blocks that cannot be resolved analytically. Input is directly fed by the output.
Solve we can use Unit delay block to avoide Algebraic loop error.
Division by Zero:
It occurs when a block attempts to perfarm a division operation with a denominator equal to zero,
which is mathematically undefined.
Use protective logic.
Missing Refrence block error:
It occurs when a referenced model an library block it missing from the specified location or file path.
Compilation error because of the Merge block:
Compilation errors with the merge block can occur due to incorrect input connections on datatypes mismatch.
Reason for the from block not receiving data:
The from block may not receive data if it is not property connected to the corresponding Goto block an if there are signal naming on data type mismatches between them.
How to decide if the developed model is in line with requirements?
To ensure that the developed model aligns with requirements, conduct thorough verification and validation activities, compare simulation results with expected behavior, and perform extensive testing, to verify that the model meets the specified requituments.
What is the use of unit testing?
Unit testing verifies individual units an components af a system to reliability ensure their correctness and reliability. It helps identity and fix defects early in the development process.
What is Black Box Testing?
The Black Box Test is a Test that only considers the external behavior of the system not in internal working.
What is White Box Testing?
The White Box Test is a method used to test a software taking into consideration its internal functioning.
What is Model Coverage and types of Coverages?
Model Coverage: It is measure af how much design is covered by simulation testing to assess testing. effectiveness and completeness.
If all the conditions & decisions are executed at least once with all possible values.
1.Decision Coverage
2.Condition Coverage
3.Modified Condition/decision coverage (MC/DC).
Decision Coverage: Decision Coverage analyzes elements that represent decision points in a model. It determines the percentage of total number of simulation paths through the item that the gimulation traversed.
Condition Coverage: Condition coverge, analyzes blocks that autput the logical combination af, this inputs. A test case achives full coverage when it causes each input to each instance of a logic block in the model and each condition on a transition tobe true at least once during simulation.
MC/DC (Modified Condition/Decision Coverage):
It is for every possible condition determines all the possible decisions at least once.
Each condition in a decision is shown to independently affects outcome of decisions.
For a decision with N Boolean variables, at least N+1 test steps are required.
What is MIL, SIL, PIL & HIL?
MIL (Model In Loop):
1.Testing the model whether it work as per the requirement.
2.This is a requirement based functionality test.
SIL (Software In Loop):
1.Testing the code cotar generated code whethe it warking as same as model.
2.This is a Back to Back test, same test cases can be used from MIL.
PIL (Processar In Loop):
1.Testing the code compatibility with the Target Processal
2.checking data approximations within tolerance.
HIL (Hardware In Loop):
The process af testing, a vehicle’s hardware by integrating it into a software environment and simulating different real-life scenarios for the hardware to react to.
What is the use of the Saturation block?
The saturation block limits the output signal within specified upper and lower bounds, preventing signal values from exceeding these limits.
Difference between Unit Delay and Memory block?
Both the Unit Delay and Memory block store the previous values.
Unit Delay block updates its output at each timestep.
Memory block updates only when triggered.
Difference between Constant and Parameter?
Constant is a value which can’t be changed in the model.
Parameter is a value which can be changed according to the requirement.
Diffrence between the Inport and outport blocks?
Inport block receives external input. data to a simulink model,
Outport block sends the data from within the model to the external environment.
What is the use of the scope block?
Providing a graphical representation of the signal values.
How to use the MATLAB Function block?
MATLAB Function block allows to write custom MATLAB code to perfarm specific operations within a simulink model.
Difference between an Integrator and Unit Delay block?
Integrator block perfarms numerical integration of a dignal over time
Unit Delay block stores the previous value of the signal and outputs it at the next time step.
TargetLink Data Dictionary?
Target Link Data Dictionary is a key component of Targetlink and it serves as a central repository for storing and managing data, parameters and signals used in the development of embedded control software fot modeling.
Simulink Data Dictionary?
A Simulink Data Dictionary object represents a data that are relevent to a model. It is a signal & data maintaining repository where the signals & calibration data maintained or loaded in the form of M-script in the base workspace.
Automatic Code Generation?
Production code generation converts models into production code for electronic control units (ECUs).
TargetLink: Targetlink is a software for automatic code generation, based on a subset of Simulink/Stateflow models, produced by dSPACE GmbH.
→TargetLink generates both ANSI-C and production Code optimized for specific processors TargetLink also supports the generation af AUTOSAR-compliant code for software components for the automotive sector.
→TargetLink is specifically designed for automotive software dewelopment, focusing on safety-critical applications and complying with industry standards ISO26262.
→It offers a high level of automation for code generation and supports various optimization techniques to improve the efficiency af generated code.
Embedded Coder:
→Embedded Codes is mare general-purpose and can be used in a wider range af industries beyond automotive, induding arospace, industrial automation and more.
→It provides mose flexibility in terms of code generation options, including support fur different target languages and processor architectures.
What is stateflow in Simulink and what are its main features?
Stateflow is a graphical tool, In simulink used for modeling and simulating complex logic and control systems.
It’s main features include state-based modeling, event-driven behavior and supports far creating hierarchical state machines.
What are temporal logic operators?
Temporal logic operators, such as ‘after’, ‘every’ and within’ are used to define timing constraints and durations in stateflow charts.
How can we debug and validate stateflow charts?
Stateflow offers debugging features like break points, watchpoints and animation to inspect and validate the behavios of the stateflow chart during simulation
How can we debug and validate stateflow charts?
Stateflow offers debugging features like break points, watchpoints and animation to inspect and validate the behavios of the stateflow chart during simulation
Difference between State Chart and Flow Chart?
State Chart | Flow Chart |
1.A state chant in Stateflow is used to represent a. state-based behavior an finite state machine (FSM). 2.It consists of states, transistions and events that define the system, Behaviar in response to diffrent conditions. 3.They are well suited far representing mactive systems where the behawior depends on the current state and incoming wents. | 1.Flow chart in stateflow is used to represent a flow-based Logic as control flow diagrams. 2.It consists of states & junctions connected by transistions & it does not have explicit support forevents. 3.They are well-suited for modeling continous processes with a clear sequence of stepsand no explicit notion of state or state transitions |