Answered
How to draw the letter phi on matlab?
Here are bunch of greek characters and how you can put them in a string/character: sprintf('%c ', 910:1000) phi = sprintf('%c'...

1 year ago | 0

Answered
Can I see code changes in the editor window?
You can right click the .m file on Matlab's 'Current Folder' view. There under the 'Source Control' you have options to 'Compare...

1 year ago | 0

Answered
Could anyone tell me what it means in the code(xfer1(i) = xfer(5,1))?
So from the context, it seems like 'xfer' is the complex value of your transfer function at a particular 'w', it is a 5x5 matrix...

1 year ago | 2

| accepted

Answered
How to plot 3-D bode from the derived transfer function?
Here is one way: % undamped system where w defines the natural frequency and s is the % s-domain frequency grid variable sys ...

1 year ago | 0

Answered
Display of nodal values of a matrix
You can use patch and text functions: nrRow = 4; % number of rows nrCol = 6; % number of columns recW = 0.5;% rectangle wid...

1 year ago | 0

Answered
Two sets of data with two date ranges and y-axis values
Something like this maybe: % create dummy time and data vectors t1 = datetime(2013,11,1,8,0,0); % define random start of time ...

1 year ago | 0

Answered
How to write theta - theta bar as a axis label
scatter(1:10,rand(1,10) , "Filled"); grid on xlabel('$\theta$ - $\bar{\theta}$','interpreter', 'latex')

1 year ago | 1

| accepted

Answered
Plotting functions of more than one variable, f(x,y)
A simple code: y = -20:0.001:20; % define y y(y==0) = []; % remove y == 0 for to prevent division by zero in x2 equation x1...

1 year ago | 0

Answered
How to plot multiple saved figures as .fig into a single figure?
Check this answer, I think it will be helpful for you.

1 year ago | 0

| accepted

Answered
How to calculate the difference error between Runge-Kutta Order 4 Method and euler method?
You can add a 'eul' function for euler integration and take the norm of the difference between the resulting outputs. clear all...

1 year ago | 0

| accepted

Answered
Assemble Global Stiffness Matrix
I think this is what you are looking for. You can extend the logic in a better way if you have more than 3 nodes. % create rand...

1 year ago | 1

Answered
Add a red line on the graph
If you want to put a vertical line on an x value, you can also use plot(0:0.01:2*pi,sin(0:0.01:2*pi)) % random plot xline(3,'r...

1 year ago | 0

Answered
Good day, I need help in building a reference signal from an ISO Specification. I have tried "create signal app"; however, it does not help much.
Something like this maybe clc tInit = 2; % initial Ub duration tFin = 2; % final Ub duration tr = 0.2; t6 = 0.4; t7 = 0.7;...

1 year ago | 1

| accepted

Answered
Numerical precision in subtracting two almost identical variables?
Here is your answer link Its all in the low level things. If you display your values with 'format hex', you will see they diffe...

1 year ago | 0

Answered
Solution of Growth problem
You overwrite the y0 and t variable within the function with this code: y0 = [100; 300; 500; 125; 100; 200]; t = 3; So the u...

1 year ago | 2

Answered
Creating multiple cylinders in different coordinates
Not sure how you want them to look or what you need but here is one simple way [X,Y,Z] = cylinder(2); % create X,Y,Z coordinate...

1 year ago | 0

Answered
How to write test case for mil and sil testing
This is a realy broad question without any specifics. I would check the Mathworks page to learn more where they provide examples...

1 year ago | 0

Answered
Defining and calling functions in MATLAB
So if you want to define them in a single script, the function needs to be at the bottom. And as others mentioned you might wan...

1 year ago | 1

Answered
Plotting 2 x-axes against 1 y-axis
I think this is what you are looking for, see the example for Display Data with Multiple x-Axes and y-Axes

1 year ago | 0

Answered
How to optimize a parameter, influencing the dynamic response of a control system
Here is a brute force way: desired_ratio = 4; Kc_vec = 0.1:0.01:10; % Kc search range ratio = NaN(size(Kc_vec)); % initiali...

1 year ago | 2

Answered
Calculate number of sprints based on sprint and time data
Based on another answer here, find below a solution: clear ,clc Fs = 1e3; % sampling rate dt = 1/Fs; t = 0:dt:100; % t...

1 year ago | 1

| accepted

Answered
How to make a sequence of time and the corresponding data from a data set where time is not provided sequentially
You cannot fill the gaps in your data without physically taking more data or interpolating. However if your problem is to order...

1 year ago | 1

| accepted

Answered
How to display the values of a Stateflow local data during simulation.
I think this is what you are looking for. Essentially you define the variable in your stateflow as a logged data (from Property...

1 year ago | 0

Answered
Transfer function extraction from frequency response
First of all, bode command does not give you numerator and denominator. It gives you magnitude and phase of the system, or FRD i...

1 year ago | 0

Answered
vectorized operations on symbolic functions
Yet another method, you can define your symbolic parameter as a matrix symbolic n = 500; X = sym('X', [500 3]); % I assume ...

1 year ago | 0

Answered
c2d transformation from s domain to z domain
For forward Euler method, plug in s = (z-1)/T where T is your sampling time For backward Euler method, plug in s = (1-z^(-1))/T...

1 year ago | 0

Answered
Why is my code returning incorrect result?
You might wanna provide the equations yu are trying to implement. Otherwise, unless someone is already familiar with the equatio...

1 year ago | 0

| accepted

Answered
User input in a struct
You cannot have space in structure field name. And also as @Dyuman Joshi mentioned you should not use quotes when you assign it....

1 year ago | 1

| accepted

Answered
write the results of two for loops with different indexes into an matrix
You need to provide more info for a better help. However here is my attempt with the limited info. There are a couple reasons ...

1 year ago | 0

Answered
how to find out the index of a cell array that cell contains my substring?
Using the @Fangjun Jiang example, how about myCellArray = {'John','Mike','foo','Jonathan','Stuart','Martha','Jo'}; substring =...

1 year ago | 1

Load more