Answered
Is there any possible to save the logical image in png?
The variable mask() is already a logical array. You don't need to convert it to logical(). Just write it as a PNG image - fon...

2 years ago | 0

| accepted

Answered
delete the third dimension in 4D matrix
You are not accessing the data stored in the struct properly. You need to use the fieldname of the corresponding data to access ...

2 years ago | 0

| accepted

Answered
Can someone check whether my script is correct or not? I did this using the same method as the one last time.
There was a missing element-wise operator in the sin() in the definition of 'k'. Also, I have modified the legend to show the e...

2 years ago | 1

| accepted

Answered
find element egual to substring in array string
From what I understood of the given information - %Input c=["A1_asd";"A2_rrd";"A_dj";"B1_gre";"B2_rffe";"B3_rffe"] %Output...

2 years ago | 0

| accepted

Answered
Why am I getting this error?
There is a missing operator between Ra and (2*L-x) in the else statement block - Update the code accordingly. %% vvv...

2 years ago | 0

Answered
double integration of function handles with two different variables
You need to use element-wise operations to define the integrand - From the documentation of integral2, the definition of the 1...

2 years ago | 0

| accepted

Answered
Help With for loop with tranfer function and step
There is no field in the struct 'S' with name 'T'. Thus you get the error in the line you defined 'S'. I suspect that you want ...

2 years ago | 1

Answered
I'm calculating using the order 3 polynomial interpolation method. But why does an array appear?
The syntax for defining an anonymouts function is incorrect in your code. Also, you are trying to take logarithm of 0, which do...

2 years ago | 0

Answered
I am trying to plot a series, with multiple variables.
Firstly - To use "n" as a symbolic variable, you will have to define it as a symbolic variable. Secondly, you have mentioned to...

2 years ago | 0

Answered
Can you answer why am I getting this error. What should Ido? The error says 'Unrecognised variable z'.
"Can you answer why am I getting this error." Because "z" has not been defined. Two things - Firstly, you are assuming that ...

2 years ago | 0

Answered
Derivative not working plot
Because x_q is empty, thus q is also empty. And plotting empty arrays leads to empty figures. a = -2.914e-07; b = 0.002246; c...

2 years ago | 0

| accepted

Answered
Revolve a Plot around y axis to generate a 3D plot
%2D Data n = 100; theta = linspace(-pi/2,pi/2,n); a=.75; b=.25; X=a*cos(theta); Y=b*sin(theta); %plot the 2D curve fig...

2 years ago | 0

Answered
Indexing with min and numel
[n,I] = min([numel(vector1),numel(vector2)]) There are 2 elements in the input array, as numel() returns a scalar value. Then ...

2 years ago | 2

| accepted

Answered
How to efficiently calculate a weighted sum of 3 dimensional matrix through a vector in matlab
%Random data A = rand(3,4,5); b = rand(5,1); C = sum(A.*reshape(b,1,1,[]), 3)

2 years ago | 0

Answered
Matlab function assumed inputs
Yes, use varargin with nargin - [x1,y1] = pricingprogramme(5,10) [x2,y2] = pricingprogramme(1,2,3,4) function [x,y] = pricin...

2 years ago | 0

| accepted

Answered
How manage for loop to calculate distances?
As the goal here is to find the distance between consecutive points - %Data lat= [-8, -8.2, -8.21, -8.34, -8.9]; long = [-18...

2 years ago | 0

| accepted

Answered
Ergebnis enthält "oder"
syms y(x) f = y(x)^2 * (diff(y(x), x))^2; eqn = functionalDerivative(f,y) == 0; %Get the equation mentioned in the question...

2 years ago | 1

Answered
Table row retrieval with dependent on column values
Rec_id =[1; 1; 2; 2; 2; 3; 3; 4; 4]; % for clarification: the values here go up to 80 in the original table Rec_type= {'A';'B';...

2 years ago | 1

| accepted

Answered
dendrogram関数の配色を任意のものにする
dendrogram is basically a group of lines. Thus, you will have to change the color of each lines accordingly - load fisheriris ...

2 years ago | 0

| accepted

Answered
how to remove all the value zero in column 2?
%Example A = num2cell([0;rand(10,1);0;0;rand(5,1);0;0;0;1]); B = num2cell(char(randi([30 50], numel(A), 1))); C = [B A] %Fin...

2 years ago | 0

Answered
solve by the matrix method
Use mldivide, \

2 years ago | 0

Answered
Side by side subplots with one split into 3
Use tiledlayout - tiledlayout(3, 2) %Span a tile across 3 rows and 1 column nexttile([3 1]) fplot(@sin) nexttile scat...

2 years ago | 1

Answered
How to run 3 script in sequence?
First of all, Never use built-in functions as variable or scripts names. You should modify the names of the scripts; for e.g. ...

2 years ago | 1

| accepted

Answered
How to define function include others functions in matlab
X = @(u) 1-u; Y = @(v) 1-v; R = @(u,v) sqrt(X(u).^2+Y(v).^2); %Integrate R w.r.t u from 0 to 1 %and w.r.t v from 1 to 2 ...

2 years ago | 1

| accepted

Answered
グラフのy軸の目盛りラベルにて、整数部の表示桁数を指定する方法について
The ticklabels are stored as the mantissa and the exponent is stored as the property of the corresponding axis (see below). So,...

2 years ago | 1

| accepted

Answered
error in using eig built-in function
The symbolic function eig does not support the syntax that you are trying to use. The numeric function eig does. So, you can...

2 years ago | 0

Answered
cell array for loop assignment
An approach without loops - A = {rand(10,2),rand(10,2),rand(10,2),rand(10,2)} B = horzcat(A{:}) C = mat2cell(B, [5 5], [2 2 ...

2 years ago | 1

Answered
How to combind a 1d Matrix with a 3d Matrix to form a 4d Matrix?
A = rand(10000,28,28); B = rand(10000,1); A = permute(A, [2 3 4 1]); B = permute(B, [4 3 2 1]); size(A) size(B) C = A.*B...

2 years ago | 0

| accepted

Answered
how to use makeUniqueStrings
Utilize the functionality of strings - vec1 = 1:10; vec2 = 4:10; [vec1 "A"+vec2]

2 years ago | 0

| accepted

Answered
fill the entry of a vector with a given distance
M = 10; A = [1;zeros(M-1,1)]; d = 3; A(d+1:d+1:end-(d+1))=1

2 years ago | 1

Load more