Answered
What is my syntax lacking to achieve an accumulative-progressing animation of the plot?
I assume you want to add a point to the graph iteration wise. In that case, try this - %Sample values density = rand(1,10); ...

2 years ago | 1

| accepted

Answered
calculate the volume of a patch object
You can use convhulln which returns the volume of the convex hull as the 2nd output.

2 years ago | 0

Answered
How to plot biggest positive and negative difference as a lines?
Hint - When you calculate the difference using diff(), the result is an array with an element less than the original array. So...

2 years ago | 0

Answered
Combining several sets of data in an array into one numeric array to make a histogram
Use vertcat to get the data into a column vector and then use histogram - %Sample data X = {rand(22,1); (1:22).'; primes(75).'...

2 years ago | 0

| accepted

Answered
I have a problem with 2D plot.
%Random data x1 = 0:0.1:40; y1 = 4.*cos(x1)./(x1+2); x2 = 1:0.2:20; y2 = x2.^2./x2.^3; %Define an axes and plot on it ax...

2 years ago | 0

Answered
Cant assign an input in a function with an elseif condition
The line where dt is defined in the script hw4_b is commented out, thus the variable is not defined, which when used to define o...

2 years ago | 0

Answered
Non-repeating selection from sets
%Random data A = 1:3; B = 1:4; C = 1:5; D = {A, B, C} n = numel(D); %Preallocate out = cell(1, n); %Reverse orde...

2 years ago | 0

| accepted

Answered
scatter plot in matlab
See the documentation of scatter. You will find all the information you need in there.

2 years ago | 0

Answered
what is the map in this example?
The variable map is part of the file mri.mat - %Check the file location which mri.mat load mri.mat %check the contents lo...

2 years ago | 0

Answered
Excel sheet work in specific column
Well, here's a way - Fr = .1; M = .2; Kp = 0.50; lambda = 0.1; Nr = 0.1; Pr = 7; Rd = 0.5; Nb = 0.5; Nt = 0.5; H = 0.01; Ec ...

2 years ago | 0

| accepted

Answered
Need a space in strcat comand
You can use strjoin again - V = [1 2 3 4 5]; out1 = strjoin(["R =" strjoin(string(V),', ')]) You can also add strings like...

2 years ago | 0

| accepted

Answered
Subs Error while using solve function
Allocate the value to P before defining the equation solve(). T = rows(Data_full); yield = zeros(T,1); syms R P for t = 1:...

2 years ago | 0

Answered
运行代码出现函数或变量无法识别
Remove the last line from the function mycg. The output is being reshaped after calling mycg in the function solve_two_poisson...

2 years ago | 0

Answered
Creating a for loop based on a condition
Use break or return.

2 years ago | 0

Answered
How to assign diffrent colors and shapes to diffirent groups in a plot?
If you have the Statistics and ML toolbox, you can utilize gscatter - Group = {'A','B','C','D','E'}; %You can convert to ca...

2 years ago | 0

Answered
Plotting subplots in one figure, with shared axes and labels
A better option would be to use tiledlayout here as you can make shared axis labels and titles - This is a general idea, you c...

2 years ago | 0

| accepted

Answered
normalize all but the zeros in a vector?
%Input in = [44 0 23 19 0 0 30]; %Lazy preallocation, assuming all values are finite and not NaNs out = 0*in; %Indexing ...

2 years ago | 1

| accepted

Answered
How can I stack two bars next to each other on top of a single bar in a bar graph?
Here's the visualization of the approach I mentioned - S = 845; mu = 0.015; g = 9.81; T1 = 360000; T3 = 360000*3; T4 = 36...

2 years ago | 0

| accepted

Answered
フォルダ内の「.avi」ファイルを一度にまとめて「.mp4」ファイルに変更することはできますか?
It would be better to use video processing tools like VLC for this instead of MATLAB. See - https://www.alphr.com/batch-convert...

2 years ago | 2

Answered
Quickest way for alternate indexing a vector
n = 9; u = [5:6:6*(n-1)+5; 7:6:6*(n-1)+7]; u = reshape(u, 1, [])

2 years ago | 2

Answered
Convert matlab index vector to 2D array based on gaps
You can vectorize the code - seg = [12 13 14 16 17 18 20 21 22 23 24]; idx = diff(seg)~=1; out = [seg(1) seg([false idx]); s...

2 years ago | 1

| accepted

Answered
double for loop is possible?
You don't need to use a double for loop here, as it goes through all possible combinations of elements of a and e_ (a(1) & e(1),...

2 years ago | 0

| accepted

Answered
スクリプトの何行目に何が書かれているかを特定する方法はありますか?
See dbtype - %Using dbtype on the built-in max() function dbtype max.m

2 years ago | 1

| accepted

Answered
create cell from array with specified size
Note that the specified size must completely divide the number of rows in the column vector - mymatrix=[1:24].'; size(mymatri...

2 years ago | 0

| accepted

Answered
Convert date data in datetime
"The problem is date corresponding to 24hrs is not coverted in datetime." Yes, because in 24 hour format, the hours are counted...

2 years ago | 0

| accepted

Answered
How to use function(s) in FEX?
Download the FEX submission, which will be downloaded as a zip file. Extract the contents in a folder. Move the folder to the c...

2 years ago | 0

| accepted

Answered
Problem with fplot - doesnt plot anything but when plotting the data individually it works
You will have to define x as a real symbolic variable (or assume that the symbolic variable 'x' is a real number). magnet.lengt...

2 years ago | 0

| accepted

Answered
Create a variable string array with different number of sig figs based on GUI dropdown
Use asterick to provide a value for field width - p = 0.105; n = 25; %sigFigs = str2double(app.SigFigDropdown.Value); ...

2 years ago | 0

| accepted

Answered
Plotting the Gaussian probability distribution for a Brownian process over time
The term inside exp() was not correct, as the 2*i term should be fully in the denominator, for which it needed to be enclosed in...

2 years ago | 0

| accepted

Answered
Error using displayFormula First argument must be string, char, or cell array of character vectors.
displayFormula expects text inputs as the error states. Use disp instead.

2 years ago | 0

Load more