Plotting multiple probability distribution plots in succession
Something like this M = rand(24, 200); % your matrix figure; for i=1:size(M,1) x = M(i, :); subplot(6, 4, i); ...

2 días ago | 0

| accepted

Subs function does not work on symbolic expressions and functions
You are overwriting the symbolic variable 'm' with numeric value on line m = solve(norm([5/m, 3/m, 0]) == 4.32, m); and after...

2 días ago | 0

Removing DC component at 0 HZ from acceleration data after fft
As described here: http://blog.originlab.com/how-to-remove-dc-offset-before-performing-fft try using a high-pass filter to remov...

2 días ago | 0

| accepted

How to capitalize words in a string (matlab)
"strrep() function is banned here". What about regexprep in = 'Hello Mello Jello Mello Hello'; out = regexprep(in, {'hello', '...

2 días ago | 0

How to plot with diferents colors
By default, the MATLAB axes only use seven colors to plot the lines. After that, the sequence is repeated if there are more then...

2 días ago | 0

Giving names to cells
Use iscell() function if ~iscell(output{i}) Also, note that save() will not accept indexing like this 'output{i}'. You will ne...

2 días ago | 0

| accepted

Timeseries Plot Between a certain time interval
See the attached file (saved in R2020a) for one of the possible ways. It uses the MATLAB function block.

2 días ago | 0

resistor with random variable number not working
There is no need to add randn(1) in the resistor value. As the documentation page mentions: https://www.mathworks.com/help/simrf...

2 días ago | 0

Problems in solve iteratively calculation
If you look at the graph of this equation, you can see that it has two solutions in the interval [0 1]. syms dt2; f = (-2.4638...

2 días ago | 0

| accepted

Importing a text or spreadsheet file to be used as a uitable.
Calling uitable() inside the function will tell MATLAB to create a new uitable. I suggest you to first add a UITable in the app ...

2 días ago | 0

exportgraphics r2020a issue
I didn't face this problem in R2020a update 2, however, I remember observing something like this (not exactly sure if it was exp...

3 días ago | 0

Choose numerical type for table2array output
Seomthing like this T=table; T.var1=ones(10,1,'uint8'); T.var2=1000*ones(10,1,'double'); array = structfun(@double, table2st...

3 días ago | 0

regexp: \w* vs \w+
\w does not match spaces. \s is used to match spaces. \w only matches a-z A-Z 0-9 and underscore. Following attempts to show the...

3 días ago | 0

| accepted

Slow computation speed using piecewise functions
Functions such as triangularPulse and piecewise are from the symbolic toolbox, and they can be very slow as compare to floating-...

3 días ago | 0

| accepted

Maximum recursion limit error
ode45 should be called outside the ODE function. Your actual ode function is this function dv=Question3(t,v) % dv/dt=8-4 dv=4...

3 días ago | 1

| accepted

Input system nonlinear (Identification)
You can use randn() u = randn(1, 1000);

3 días ago | 0

| accepted

Problem relating to mathematical expression
Try this x = [0.1, 0.2, 0.4, 0.5, 0.4, 0.6, 0.6, 0.6, 0.2, 0.3]; n = numel(x); k = 5; if round(n/k)==n/k split = mat2ce...

3 días ago | 0

How to modify decimal places when exporting data with fprintf
Try this code a = {'C1', 'A1', 'B1'}' b = {'C', 'A', 'B'}' c = {1.1, 2.1, 3.1}' d = {1.16666, 2.16666, 3.16666}' e = {'C', ...

3 días ago | 2

| accepted

Nernst Equation plotting in MATLAB
Try this code, I changed the range of T1 and used element-wise operator in the equation for Eout1 %Constant Temperature and Cha...

4 días ago | 0

| accepted

How can find the solution of this matrix system?
Try fsolve(): https://www.mathworks.com/help/releases/R2020a/optim/ug/fsolve.html sol = fsolve(@(X) X*A*X.'-B, rand(size(A)))

4 días ago | 0

How to display a variable for x and y values from code in UI Table
Run this example x1 = 1; x2 = 2; x3 = 3; y1 = 4; y2 = 5; y3 = 6; x = [x1; x2; x3]; y = [y1; y2; y3]; t = table(x, y); ...

4 días ago | 0

Is there a way to make dirac delta function be 1 at the origin?
Replace dirac with kroneckerDelta syms x f(x) = heaviside(x); g(x) = diff(f); Result >> g(0) ans = Inf Now run g(x) = s...

4 días ago | 0

| accepted

Filtering by several criteria
Something like this New=Salaries.Age_49(Salaries.Area==1 & Salaries.Year==2019) % find is not necessary, logical indexing will ...

4 días ago | 1

| accepted

How do I correctly type in the following functions into matlab
This is correct syntax syms theta t f1 = 1 + sin(theta)^2*csc(theta); f2 = 1/(1+sin(theta)); f3 = sin(t); f4 = sec(theta).^...

4 días ago | 0

create plot with slice
Try this [X, Y, Z] = meshgrid(0:0.5:20, 0:0.5:20, 1:7); V = exp(-0.2*sqrt((X-10).^2+(Y-10).^2+(2*(Z-4)).^2)); % based on gue...

4 días ago | 0

| accepted

How to pass a changing value from workspaces to Simulink?
If the value is continually changing in the base workspace, you need to use MATLAB function block and evalin() to read the updat...

4 días ago | 1

| accepted

Trial to display Capital letters on excel
xlswrite is used to write numeric matrices. If you want to write text data, then use writetable() or writecell(). For example T...

4 días ago | 0

How to insert a background image into a 3d plot?
Try something like this img = imread('peacock.jpg'); ax1 = axes(); imshow(img, 'Parent', ax1); ax2 = axes('Color', 'none...

4 días ago | 0

| accepted

How to create sum block like this (photo) on simulink?