Answered

Not able to use ode45 to solve and plot solution to vdp equation

You are missing some things. Looks like a mix of numeric and symbolic calculations, which won't work. But tou have luck - exactl...

Not able to use ode45 to solve and plot solution to vdp equation

You are missing some things. Looks like a mix of numeric and symbolic calculations, which won't work. But tou have luck - exactl...

7 days ago | 0

| accepted

Answered

How to divide column vector elements in unequal parts against a condition?

Due to different lengths of your daily data you should use a cell array: A = readmatrix('New Text Document.txt'); k_min = mi...

How to divide column vector elements in unequal parts against a condition?

Due to different lengths of your daily data you should use a cell array: A = readmatrix('New Text Document.txt'); k_min = mi...

7 days ago | 1

| accepted

Answered

how to solve inequality in matlab R2016a

In 2019b this works by using an assumption: syms x real eqn = (x-1)*(x-2)*(x-3)*(x-4)> 0; S = solve(eqn, x) % Test solutio...

how to solve inequality in matlab R2016a

In 2019b this works by using an assumption: syms x real eqn = (x-1)*(x-2)*(x-3)*(x-4)> 0; S = solve(eqn, x) % Test solutio...

8 days ago | 0

| accepted

Answered

Tspan is not strictly increasing.

Since ode45 uses an automated stepwide control just define the start and the end of your tspan this way: tspan = [0 10]; This ...

Tspan is not strictly increasing.

Since ode45 uses an automated stepwide control just define the start and the end of your tspan this way: tspan = [0 10]; This ...

8 days ago | 0

| accepted

Answered

Subplot in ODE45

d = [0.20 0.30 0.50]; for ii = 1:numel(d) sol(ii)=ode45(@(t,C)b2(t,C,d(ii)),[0 2],[130 10 5]); t{:,ii}=sol(ii).x'; ...

Subplot in ODE45

d = [0.20 0.30 0.50]; for ii = 1:numel(d) sol(ii)=ode45(@(t,C)b2(t,C,d(ii)),[0 2],[130 10 5]); t{:,ii}=sol(ii).x'; ...

9 days ago | 1

| accepted

Answered

How to print greek letters like 'ยต' in fprintf to file handle?

fileID = fopen('testFile.txt','w') fprintf(fileID,['16.0', char(181), 'm']); fclose(fileID)

How to print greek letters like 'ยต' in fprintf to file handle?

fileID = fopen('testFile.txt','w') fprintf(fileID,['16.0', char(181), 'm']); fclose(fileID)

9 days ago | 0

| accepted

Answered

Differential Equation Problem using ode45

[W,Fa] = PBR_Isothermal; % plot results subplot(3,2,1) plot(W,Fa(:,1)) subplot(3,2,2) plot(W,Fa(:,2)) subplot(3,2,3) pl...

Differential Equation Problem using ode45

[W,Fa] = PBR_Isothermal; % plot results subplot(3,2,1) plot(W,Fa(:,1)) subplot(3,2,2) plot(W,Fa(:,2)) subplot(3,2,3) pl...

10 days ago | 1

| accepted

Answered

problem in optimization by MATLAB using genetic algorithm

Change myFitness.m to: function y = myFitness(x) s = x(1) z = x(3) x = x(2) y = ...YOUR EQUATION HERE end also change thi...

problem in optimization by MATLAB using genetic algorithm

Change myFitness.m to: function y = myFitness(x) s = x(1) z = x(3) x = x(2) y = ...YOUR EQUATION HERE end also change thi...

10 days ago | 0

| accepted

Answered

optimixation by genetic algorithm using MATLAB

Get rid of the square brackets - Matlab will interpret this as one input argument of a vectorized function. Therefore it throws ...

optimixation by genetic algorithm using MATLAB

Get rid of the square brackets - Matlab will interpret this as one input argument of a vectorized function. Therefore it throws ...

10 days ago | 0

| accepted

Answered

Plotting points that pass through y for x,y,z coordinates

Data=[0.345 0.343 0.341 0.339 0.337 %sample x data -0.005 -0.002 -0.00069 0.0015 0.0034 %sample y data 0.284 0....

Plotting points that pass through y for x,y,z coordinates

Data=[0.345 0.343 0.341 0.339 0.337 %sample x data -0.005 -0.002 -0.00069 0.0015 0.0034 %sample y data 0.284 0....

11 days ago | 1

| accepted

Answered

Time-dependent parameter for ODE system

use interp1 to achieve this - an example of how to do this is here.

Time-dependent parameter for ODE system

use interp1 to achieve this - an example of how to do this is here.

11 days ago | 0

| accepted

Answered

plot a mathmatical function

https://de.mathworks.com/help/matlab/ref/fplot.html

plot a mathmatical function

https://de.mathworks.com/help/matlab/ref/fplot.html

11 days ago | 0

Answered

Intelligent symbolic variable substitution

syms f(x) z(x) fun = f == x^2 + 8*x + 16; % equals (x+4)^2 transform = z == (x+4)^2; subs(fun, rhs(fun), lhs(transform))...

Intelligent symbolic variable substitution

syms f(x) z(x) fun = f == x^2 + 8*x + 16; % equals (x+4)^2 transform = z == (x+4)^2; subs(fun, rhs(fun), lhs(transform))...

13 days ago | 0

Answered

Use Splitapply to write multiple files

Here is a small example of how it could work: % some data to play with Gender = ['m' 'm' 'w' 'w' 'm' 'w']'; Age = randi(60,6,...

Use Splitapply to write multiple files

Here is a small example of how it could work: % some data to play with Gender = ['m' 'm' 'w' 'w' 'm' 'w']'; Age = randi(60,6,...

16 days ago | 0

| accepted

Answered

Find column where one value is NaN

res = find(~isnan(a(1,:)) & isnan(a(2,:))==1)

Find column where one value is NaN

res = find(~isnan(a(1,:)) & isnan(a(2,:))==1)

16 days ago | 0

| accepted

Answered

Solving 2 Trigonometric Equation with 2 Unknowns

You can solve the whole system numeric by using *|fsolve|*: [sol,res]=runfun function [sol,res] = runfun px=387.4162; py...

Solving 2 Trigonometric Equation with 2 Unknowns

You can solve the whole system numeric by using *|fsolve|*: [sol,res]=runfun function [sol,res] = runfun px=387.4162; py...

17 days ago | 0

Answered

Solving a differential equation

Hi there were some bugs in this code - see my comments V1=3; Gin=216; alpha=0.5; t1=6; V3=10; tau2=50; Eg=180; tau1=5; ...

Solving a differential equation

Hi there were some bugs in this code - see my comments V1=3; Gin=216; alpha=0.5; t1=6; V3=10; tau2=50; Eg=180; tau1=5; ...

17 days ago | 0

| accepted

Answered

How to solve system of 2nd order differential equations using ode45

plot3(t,x(:,1),x(:,3))

How to solve system of 2nd order differential equations using ode45

plot3(t,x(:,1),x(:,3))

19 days ago | 0

| accepted

Answered

summing along 3rd dimension every 10 frames

If A is your matrix: B = sum(reshape(A,32,32,10,[]),3);

summing along 3rd dimension every 10 frames

If A is your matrix: B = sum(reshape(A,32,32,10,[]),3);

21 days ago | 0

Answered

wo kann ich das R2018b runter laden, eine Matlablizenz habe ich

<https://de.mathworks.com/downloads/web_downloads/select_release?mode=gwylf>

wo kann ich das R2018b runter laden, eine Matlablizenz habe ich

<https://de.mathworks.com/downloads/web_downloads/select_release?mode=gwylf>

21 days ago | 1

Answered

Why does this for loop fail?

|vpasolve| may find more than one solution. Try to save your results in a cell array: ... Vrange = cell(1, length(Trange))...

Why does this for loop fail?

|vpasolve| may find more than one solution. Try to save your results in a cell array: ... Vrange = cell(1, length(Trange))...

25 days ago | 0

| accepted

Answered

How to use fsolve with a variable parameter?

Define the values fot T21 that you want to calculate for. Then use a for loop and call your function inside the loop as often as...

How to use fsolve with a variable parameter?

Define the values fot T21 that you want to calculate for. Then use a for loop and call your function inside the loop as often as...

25 days ago | 2

| accepted

Answered

How to extract diagonal line data from image

The result for every line object contains an information about the angle of the line. This information can be used as input to <...

How to extract diagonal line data from image

The result for every line object contains an information about the angle of the line. This information can be used as input to <...

25 days ago | 0

Answered

logspace equivalent and sin(x) [solved]

x = 10.^(1:3) % x=logspace(1, 3, 3) result = sum(A>0.5) % Number of elements in A bigger than 0.5

logspace equivalent and sin(x) [solved]

x = 10.^(1:3) % x=logspace(1, 3, 3) result = sum(A>0.5) % Number of elements in A bigger than 0.5

25 days ago | 1

| accepted

Answered

coding error ode45

If possible try to avoid global variables: %define parameters %x is the number of cancer cells x0 = 1000; % c2 is the number...

coding error ode45

If possible try to avoid global variables: %define parameters %x is the number of cancer cells x0 = 1000; % c2 is the number...

25 days ago | 0

| accepted

Answered

Remove noise from screw image

Replace the medfilt2 by a gaussian blur using imgaussfilt: %% read image and find points that should lie on a straight line A ...

Remove noise from screw image

Replace the medfilt2 by a gaussian blur using imgaussfilt: %% read image and find points that should lie on a straight line A ...

25 days ago | 1

Answered

Detect orientation of screw image

Using this script lets you know which angle to rotate. Then use this information to rotate the image and check the orientation a...

Detect orientation of screw image

Using this script lets you know which angle to rotate. Then use this information to rotate the image and check the orientation a...

25 days ago | 1

| accepted

Answered

Multiple output values on an if else loop

in every run of your loop you overwrite WeightF. Use indexing to avoid this: WeightF(i) = ... also using i for loop count is n...

Multiple output values on an if else loop

in every run of your loop you overwrite WeightF. Use indexing to avoid this: WeightF(i) = ... also using i for loop count is n...

25 days ago | 0

Answered

Create a matrix that stores rows that are not from a random sample

A way smarter is using the ismember function - here is an example - all you need ist the last line, the first two lines are just...

Create a matrix that stores rows that are not from a random sample

A way smarter is using the ismember function - here is an example - all you need ist the last line, the first two lines are just...

25 days ago | 0

Answered

how to Conversion transfer function to state space ...MIMO help me

<https://de.mathworks.com/help/control/ref/ss.html?s_tid=doc_ta#f4-373013 Convert Transfer Function to State-Space Model>

how to Conversion transfer function to state space ...MIMO help me

<https://de.mathworks.com/help/control/ref/ss.html?s_tid=doc_ta#f4-373013 Convert Transfer Function to State-Space Model>

1 month ago | 0