Answered
How can I create a random matrix without repeating any value between column
You can use reshape(), randperm(), numel(), size() fcns to create ramdom swaps of the already existing matrix elements: A1 = [1...

3 years ago | 0

Answered
Need to change some (not all) values in a Histogram.
You can use simply this: N1 = sum(DATA==1); % How many 1s in Data N2 = sum(DATA==2); % How many 2s in Data N3 = sum(DATA==3);...

3 years ago | 0

| accepted

Answered
Extract set of gains from data file
It is possible only if your have your input data and preseumably, you have gotten the system response data. Using the system ide...

3 years ago | 0

Answered
How to make a line plot and indicating data gap?
Here is how it can be done. Note that there are only 4 individual data points are missing and thus, they can be displayed indivi...

3 years ago | 1

| accepted

Answered
What do I need to change in matlab example?
If you look at carefully to the documentation, it states explicitly that you'd need to load your data: ... data = load('vehicl...

3 years ago | 0

Answered
Creating plot with 2 x axes from property inspector?
Here is a doc for two x-axes and y-axes: DOC Here is how to create two x-axes: x1=0:.1:2*pi; Y1 = sin(2*x1); x2 = -pi:.1:pi;...

3 years ago | 0

Answered
Hi guys I want to write a code to calculate G11, for each station in range frequencies 0 to 15 and plot im(G11) against frequencies. I write the below code but it doesn't work
There are a couple of mistakes: (1) Indices can be "0"- see loop i = 0:length(stations), j=0:length(frequencies) (2) The last ...

3 years ago | 0

| accepted

Answered
solve function with two variables by ga toolbox
Here is how it can be solved with GA: lb = [0.001, 0.01]; ub = [0.045, 0.1]; numberOfVariables = 2; y=@(x) 0.25-4.27*x(1)+0....

3 years ago | 0

Answered
Writing inside cell array
If understood correctly your question, here is how it can be solved: t = randn(1); g = sin(2*pi*t); f = repmat(g, 1,100)+rand...

3 years ago | 0

Answered
Scatter datatips won’t display with callback
You can enable datatip using a couple of commands: see DOC1 Also, you can make it interactive: see DOC2

3 years ago | 0

Answered
How can we determine how many peaks are at each plot?
Use findpeaks() fcn: see DOC e.g.: t = linspace(0, 2, 1000); % Time fs = 1/t(2); % Sampling freq [Hz] f...

3 years ago | 0

Answered
Integration with Symbolic Variables
Use integral() - see DOC E.g.: % Step 1. Create a function handle: F = @(theta, a)sqrt((a*(1-cos(theta))).^2+(a*(1-sin(theta)...

3 years ago | 0

Answered
How do I get smooth edges for a contourf plot on a log-log scale scatterplot?
Here is how you can get the straight lines along edges: MFR_1 = [0.93016, 0.13933, 0.04154; 4.75072, 0.96454, 0.27638; 16.1767,...

3 years ago | 0

Answered
How can I input values?
You code contains several crucial errors including wrong call of fcn, wrong placements of commands after the fcn file, wrong inp...

3 years ago | 0

Answered
How to make the error below each other in the text box
Use { } in strcat() and ; (semicolon), to start a new error message from the following line in your msgbox. Here is the correcte...

3 years ago | 0

| accepted

Answered
Integration when some of the values change over time
Simply write a code, e.g.: t=linspace(0, 5, 200); F = 5*cos(2*pi*t); xk = 2*sin(2*pi*5*t); x = linspace(0,25); for ii = 1:n...

3 years ago | 0

Answered
i couldnt able to slove this please help me
Provide your parameter values Twr, Wr_ref, Tbeta, Kwr, etc.

3 years ago | 0

Answered
How to make the error below each other in the text box
Here is how I would do (see my some arbitrary numerical values for display): msg_V_breadth_min = sprintf('#2 Error Loading Para...

3 years ago | 0

Answered
Problems with circuit breaker.
Are you using the right converter block from Simulink to PS?

3 years ago | 0

Answered
How can I plot from csv file?
Here is how to get some shadow error plot: % Way 1. Not nice looking plot D = readmatrix('https://www.mathworks.com/matlabcent...

3 years ago | 0

| accepted

Answered
How to draw a CIELAB color chart?
Here are several fcn files on MATLAB file exchange to visualize cielab plot: https://www.mathworks.com/matlabcentral/fileexchang...

3 years ago | 0

Answered
Reading '*.xlsm' files
There might be another case that your intended data file(s) is (are) open and cursor is inside the file.

3 years ago | 0

Answered
Table element access problem
Use this standard syntax to read the data from MS Excel into a table array: % Way 1: Simple one MY_file = 'DATA_Exp.xlsx'; ...

3 years ago | 0

Answered
How to get effective parameter graph?
Without seeing your data, one quick suggestion is: Using yyaxis option for two different data sets and use y-axis limit, e.g.: ...

3 years ago | 0

Answered
error "Index in position 2 exceeds array bounds. Index must not exceed 6."
Here is the corrected code. Note ny is to be for j and nx is for j. The order was swaped. E = 207e9; % Modulus of elasticity (...

3 years ago | 0

| accepted

Answered
Weighted Average for a certain depth
For the weighted mean calcution - see this MATLAB submission -

3 years ago | 0

Answered
Easiest way to make input dialog box with multiple checkboxes?
Here are a couple of good docs - DOC1, DOC2

3 years ago | 0

Answered
Using the fourier series to approximate a triangular wave.
Here is one simple code how to generate sawtooth approximation using different Fourier series: t = linspace(0, 10, 1000); Phas...

3 years ago | 0

Answered
Create a step in a graph
In this exercise, no need to use a loop to obtain a step fcn. Way1 is using simple matrix operation: aux1=70*1200; aux2=7...

3 years ago | 0

| accepted

Load more