Answered

How to set Assumptions for function handle?

See fimplicit3 example here and use interval argument: f = @(x,y,z)x.^2+y.^2+z.^2-1; fimplicit3(f, [-1, 1, -1, 1, 0, 1])

How to set Assumptions for function handle?

See fimplicit3 example here and use interval argument: f = @(x,y,z)x.^2+y.^2+z.^2-1; fimplicit3(f, [-1, 1, -1, 1, 0, 1])

1 year ago | 0

| accepted

Answered

Loop function takes too long. How can I reduce the processing time?

Yes, diff in as inbuilt and vectrorized function to get what you want. Run this command on a vector input will give you all the ...

Loop function takes too long. How can I reduce the processing time?

Yes, diff in as inbuilt and vectrorized function to get what you want. Run this command on a vector input will give you all the ...

1 year ago | 0

Answered

Splitting code into groups

Note that the run button will run all your code in one, while the other buttons will run you code section wise and go / go not t...

Splitting code into groups

Note that the run button will run all your code in one, while the other buttons will run you code section wise and go / go not t...

1 year ago | 0

Answered

Solution to a simple equation

use isolate instead of solve: clear all; close all; syms R L C omega eqn=1 - 2*C*L*omega^2 + C^2*R^2*omega^2 + C^2*L^2*omega^...

Solution to a simple equation

use isolate instead of solve: clear all; close all; syms R L C omega eqn=1 - 2*C*L*omega^2 + C^2*R^2*omega^2 + C^2*L^2*omega^...

1 year ago | 0

| accepted

Answered

how to make a function of this system

syms a b y1(t) y2(t) ode(1,1) = diff(y1,t,2) == a*y2 - cos(diff(y1,t)); ode(2,1) = diff(y2,t) == b*y1 + cos(t) [V,S] = od...

how to make a function of this system

syms a b y1(t) y2(t) ode(1,1) = diff(y1,t,2) == a*y2 - cos(diff(y1,t)); ode(2,1) = diff(y2,t) == b*y1 + cos(t) [V,S] = od...

1 year ago | 1

Answered

error with plotting graph

Since theta is a vector you need to perform elementwise multiplication: a = 13; c = 17; k = 2*pi/3; theta = 0:0.0001:2*pi; ...

error with plotting graph

Since theta is a vector you need to perform elementwise multiplication: a = 13; c = 17; k = 2*pi/3; theta = 0:0.0001:2*pi; ...

1 year ago | 1

Answered

Getting error with the code in ode45 function

t=[0 5]; inity = 1; [t,y]=ode45(@f, t, inity); plot(t,y) function dy = f(~,y) % y=[9,100]; dont overwrite y D=0.00000001; ...

Getting error with the code in ode45 function

t=[0 5]; inity = 1; [t,y]=ode45(@f, t, inity); plot(t,y) function dy = f(~,y) % y=[9,100]; dont overwrite y D=0.00000001; ...

1 year ago | 0

| accepted

Answered

How can I plot the Temperature distribution in this code.

Play arround with slice: % LBM 3D - D3Q15 Heat Diffusion in a Plate % Problem - 5.10 clc clear variables close all alpha =...

How can I plot the Temperature distribution in this code.

Play arround with slice: % LBM 3D - D3Q15 Heat Diffusion in a Plate % Problem - 5.10 clc clear variables close all alpha =...

1 year ago | 1

| accepted

Answered

How to multiply a matrix to another cell matrix

Use cellfun: A = magic(3) C = {rand(3,4); rand(3,4); rand(3,4); rand(3,4); rand(3,4)} result = cellfun(@(x)mtimes(A,x),C,'Uni...

How to multiply a matrix to another cell matrix

Use cellfun: A = magic(3) C = {rand(3,4); rand(3,4); rand(3,4); rand(3,4); rand(3,4)} result = cellfun(@(x)mtimes(A,x),C,'Uni...

1 year ago | 1

| accepted

Answered

Why do the ode45 solver is not running in my code?

Your problem appears to be stiff - use ode15s instead: clear; clc; a = 1; %alpha p = 7.5; %rho b = 4; %beta g = 16; %gamma ...

Why do the ode45 solver is not running in my code?

Your problem appears to be stiff - use ode15s instead: clear; clc; a = 1; %alpha p = 7.5; %rho b = 4; %beta g = 16; %gamma ...

1 year ago | 0

| accepted

Answered

i'm getting this error "Unable to perform assignment because the left and right sides have a different number of elements"

Problem 1 h returns more than one solution which produces the error because the result of xa1(i+1)=I2(i)+h*S2(1) with h bein...

i'm getting this error "Unable to perform assignment because the left and right sides have a different number of elements"

Problem 1 h returns more than one solution which produces the error because the result of xa1(i+1)=I2(i)+h*S2(1) with h bein...

1 year ago | 1

Answered

percent of similarity between images

When using a neural net you could use the score output argument to get this. Look at this example there is a bar chart based on ...

percent of similarity between images

When using a neural net you could use the score output argument to get this. Look at this example there is a bar chart based on ...

1 year ago | 0

| accepted

Answered

How I can append matrices of different dimensions in another matrix?

A = randi(10, 3, 1) B = rand(4, 1) C = randi(10,5,1) D = vertcat(A,B,C)

How I can append matrices of different dimensions in another matrix?

A = randi(10, 3, 1) B = rand(4, 1) C = randi(10,5,1) D = vertcat(A,B,C)

1 year ago | 0

| accepted

Answered

Checking if 2 edges in a graph are connected

You could use the neighbors function, which gives a list of connected nodes for a given node. You could combine this with the is...

Checking if 2 edges in a graph are connected

You could use the neighbors function, which gives a list of connected nodes for a given node. You could combine this with the is...

1 year ago | 0

| accepted

Answered

hi guys, I want to make a spectral RollofPoint of speech and when I enter this code from mathworks, I get this error that the variable t1 is not declared, even though I declared it. Please I will be happy for every piece of advice.

You have to run code so that the variables appear in your workspace. go to the editor tab and press "run". the editor tab appear...

hi guys, I want to make a spectral RollofPoint of speech and when I enter this code from mathworks, I get this error that the variable t1 is not declared, even though I declared it. Please I will be happy for every piece of advice.

You have to run code so that the variables appear in your workspace. go to the editor tab and press "run". the editor tab appear...

1 year ago | 0

| accepted

Answered

how to remove spaces in a string?

A = ["Ly R4", "Ba R7", "Ty Ru"] B = erase(A," ")

how to remove spaces in a string?

A = ["Ly R4", "Ba R7", "Ty Ru"] B = erase(A," ")

1 year ago | 1

| accepted

Answered

Using previous value to get the next in for loop

The semicolon operator supresses outputs to the command window: h=0.1; y(1) = 0; for k=2:6003 y(k) = y(k-1) + h.*u(k-1);...

Using previous value to get the next in for loop

The semicolon operator supresses outputs to the command window: h=0.1; y(1) = 0; for k=2:6003 y(k) = y(k-1) + h.*u(k-1);...

1 year ago | 0

| accepted

Answered

Converting Cell matrix to a Numeric Matrix

B={'2' '3' '5'; '4' '7' '2'; '7' '5' '2'} C = cellfun(@(x)str2double(x),B)

Converting Cell matrix to a Numeric Matrix

B={'2' '3' '5'; '4' '7' '2'; '7' '5' '2'} C = cellfun(@(x)str2double(x),B)

1 year ago | 1

| accepted

Answered

extracting droplets with fringes from a image

Have a look at imfindcircles. It might be useful to run imbinarize first.

extracting droplets with fringes from a image

Have a look at imfindcircles. It might be useful to run imbinarize first.

1 year ago | 0

Answered

Multiplication of two different continuous signal in Matlab

You made a mistake in defining t2...t6: x = 0:0.05:6; y = sin(x); subplot(3,1,1) plot(x,y) t1 = 0:0.05:1; t2 = 1.05:0.05:2...

Multiplication of two different continuous signal in Matlab

You made a mistake in defining t2...t6: x = 0:0.05:6; y = sin(x); subplot(3,1,1) plot(x,y) t1 = 0:0.05:1; t2 = 1.05:0.05:2...

1 year ago | 0

| accepted

Answered

Datetime coloumn in a matrix of double

You can not mix data types in arrays - use a table or a timetable to do this. In your case the array2table or array2timetable mi...

Datetime coloumn in a matrix of double

You can not mix data types in arrays - use a table or a timetable to do this. In your case the array2table or array2timetable mi...

1 year ago | 0

| accepted

Answered

Function that returns the number given squared

https://de.mathworks.com/help/matlab/ref/function.html?s_tid=doc_ta#btexm3w

Function that returns the number given squared

https://de.mathworks.com/help/matlab/ref/function.html?s_tid=doc_ta#btexm3w

1 year ago | 0

Answered

Matlab plot problem line 13

syms r E y K eqn = r*(1-y/K)*y-E*y==0; S = solve(eqn); y1=S(1); y2=S(2); h=0.01; E=1; r=2; K=1; y = double(y1-h:h:subs(...

Matlab plot problem line 13

syms r E y K eqn = r*(1-y/K)*y-E*y==0; S = solve(eqn); y1=S(1); y2=S(2); h=0.01; E=1; r=2; K=1; y = double(y1-h:h:subs(...

1 year ago | 1

Answered

How to produce square matrix in this form

k = 2; % define how often to repeat the pattern result = toeplitz([5 repmat([1 0 0 0],1,k)]) gives: result = 5 1 ...

How to produce square matrix in this form

k = 2; % define how often to repeat the pattern result = toeplitz([5 repmat([1 0 0 0],1,k)]) gives: result = 5 1 ...

1 year ago | 1

| accepted

Answered

how do i plot a complicated function

alpha = 2; gamma = 3; k1 = 0.5; k2 = 0.15; syms eta(x,y) Eta eta(x,y) = (sqrt((x*k1+gamma*(1-y)-alpha)^2-4*x.*(gamma*k2...

how do i plot a complicated function

alpha = 2; gamma = 3; k1 = 0.5; k2 = 0.15; syms eta(x,y) Eta eta(x,y) = (sqrt((x*k1+gamma*(1-y)-alpha)^2-4*x.*(gamma*k2...

1 year ago | 1

Answered

Solve equation (unrecognized function or variable)

% define t as symbolic syms t N = 5.62; R = 6.40; W = 600; eqn = (10 + 2.*W.^(2).*t.^(2) - 8.*W.^(4).*t.^(4))./(10 +23.*...

Solve equation (unrecognized function or variable)

% define t as symbolic syms t N = 5.62; R = 6.40; W = 600; eqn = (10 + 2.*W.^(2).*t.^(2) - 8.*W.^(4).*t.^(4))./(10 +23.*...

1 year ago | 0

| accepted

Answered

How to doI plot F(x) = [1 -(10/x)]/[1-(100/x^2)] for X ranging from 100 to 1100 at an interval of 50?

F = @(x) (1-(10./x))./(1-(100./x.^2)); x_vals = 100:50:1100; plot (x_vals, F(x_vals))

How to doI plot F(x) = [1 -(10/x)]/[1-(100/x^2)] for X ranging from 100 to 1100 at an interval of 50?

F = @(x) (1-(10./x))./(1-(100./x.^2)); x_vals = 100:50:1100; plot (x_vals, F(x_vals))

1 year ago | 2

Answered

Change frame rate of video file

You are fully right. First read all the frames using the read command for VideoReader. Then make a VideoWriter object and use th...

Change frame rate of video file

You are fully right. First read all the frames using the read command for VideoReader. Then make a VideoWriter object and use th...

1 year ago | 1

Answered

How to optimise two variables at once

b = 166; %inertance c = 2000; %damping value lb = [0 500]; % lower bound ub = [500 3000]; % upper bound x0 = [b, c]; %...

How to optimise two variables at once

b = 166; %inertance c = 2000; %damping value lb = [0 500]; % lower bound ub = [500 3000]; % upper bound x0 = [b, c]; %...

1 year ago | 0

| accepted