Answered

how can i imagie zoom with Convolution method

It is deliberate that the following does not do exactly what you want to do. It is also deliberate that it has some extra steps ...

how can i imagie zoom with Convolution method

It is deliberate that the following does not do exactly what you want to do. It is also deliberate that it has some extra steps ...

5 days ago | 0

Answered

How can I simplify my code using loops?

Put the channels into a cell array: lena_ch = num2cell(lena, [1 2]); Now you can loop over the rows of indices = perms(1:3) ...

How can I simplify my code using loops?

Put the channels into a cell array: lena_ch = num2cell(lena, [1 2]); Now you can loop over the rows of indices = perms(1:3) ...

5 days ago | 0

Answered

I need help writing equation in matlab

format long g syms x n m result = symsum(x^n/factorial(n), n, 0, m) limit(result, m, inf) result20 = subs(result, m, 20) ex...

I need help writing equation in matlab

format long g syms x n m result = symsum(x^n/factorial(n), n, 0, m) limit(result, m, inf) result20 = subs(result, m, 20) ex...

5 days ago | 0

Answered

How can I make the execution speed consistent while I am testing the speed of the programs?

I am not convinced that virtual machines will be allocated dedicated resources that will not be affected by other activities. ...

How can I make the execution speed consistent while I am testing the speed of the programs?

I am not convinced that virtual machines will be allocated dedicated resources that will not be affected by other activities. ...

5 days ago | 0

Answered

Hello, I've got the problem. Can any one help me with that error?

cond = [x(0)==0, diff(x, t)==0]; The first part of that sets a boundary condition. The second part of it says that the deri...

Hello, I've got the problem. Can any one help me with that error?

cond = [x(0)==0, diff(x, t)==0]; The first part of that sets a boundary condition. The second part of it says that the deri...

6 days ago | 0

Answered

how can I calculate A^n when n is a symbolic positive integer?

syms N positive integer [V, D] = eig(sym(A)) result = V*diag(diag(D).^N)/V Note those are the matrix operations *...

how can I calculate A^n when n is a symbolic positive integer?

syms N positive integer [V, D] = eig(sym(A)) result = V*diag(diag(D).^N)/V Note those are the matrix operations *...

6 days ago | 0

| accepted

Answered

how to run a function on GPU cores

You would have to use <https://www.mathworks.com/help/gpucoder/index.html> Nvidia GPUs are constructed in a hierarchy. GPU co...

how to run a function on GPU cores

You would have to use <https://www.mathworks.com/help/gpucoder/index.html> Nvidia GPUs are constructed in a hierarchy. GPU co...

6 days ago | 1

Answered

Hi, I am trying to produce randomly circles with same radius in defined range or square. I wrote the code, but it show error " Out of memory. The likely cause is an infinite"

function h = circle(x,y,r, N) ... for i=1:1:size(circle) circle is not a local variable in the function circle, and is not th...

Hi, I am trying to produce randomly circles with same radius in defined range or square. I wrote the code, but it show error " Out of memory. The likely cause is an infinite"

function h = circle(x,y,r, N) ... for i=1:1:size(circle) circle is not a local variable in the function circle, and is not th...

6 days ago | 0

Answered

Axis Ticks using Calendar Year ticks with BC years

YearTicks = datetime({'1950 CE'; '1725 CE'; '1501 CE'; '1277 CE'; '1053 CE'; '0828 CE'; '0604 CE'; '0380 CE'; '0156 CE'; '0069 C...

Axis Ticks using Calendar Year ticks with BC years

YearTicks = datetime({'1950 CE'; '1725 CE'; '1501 CE'; '1277 CE'; '1053 CE'; '0828 CE'; '0604 CE'; '0380 CE'; '0156 CE'; '0069 C...

6 days ago | 0

| accepted

Answered

Simlify a function in matlab

syms B C x eqn = cos(x) + B*sin(x) == C expr = -sin(x) + B*cos(x) xsol = solve(eqn,x) newexpr = simplify(subs(expr, x, xso...

Simlify a function in matlab

syms B C x eqn = cos(x) + B*sin(x) == C expr = -sin(x) + B*cos(x) xsol = solve(eqn,x) newexpr = simplify(subs(expr, x, xso...

6 days ago | 1

| accepted

Answered

Call parfeval using global variables?

When you pass a global as a parameter, what is received in the called routine is treated as a local. For example, assigning to t...

Call parfeval using global variables?

When you pass a global as a parameter, what is received in the called routine is treated as a local. For example, assigning to t...

6 days ago | 2

Answered

How do I plot a circle on a Matlab figure?

plot(0,0,'ro','MarkerSize',10,'MarkerFaceColor','r','MarkerEdgeColor','r'); That could have several different effects. If you...

How do I plot a circle on a Matlab figure?

plot(0,0,'ro','MarkerSize',10,'MarkerFaceColor','r','MarkerEdgeColor','r'); That could have several different effects. If you...

6 days ago | 0

Answered

How do I properly convert a 64-bit binary string / Convert directly from bin or hex to uint64

F3str = 'F3007900001EFFFF' F3 = swapbytes(typecast(uint8(sscanf(F3str, '%02x')), 'uint64')) %crosscheck dec2hex(F3) isequa...

How do I properly convert a 64-bit binary string / Convert directly from bin or hex to uint64

F3str = 'F3007900001EFFFF' F3 = swapbytes(typecast(uint8(sscanf(F3str, '%02x')), 'uint64')) %crosscheck dec2hex(F3) isequa...

6 days ago | 1

Answered

How can I make a structure array

If you pass struct() a cell array of data for a field, then it creates a struct array with the same size() as the size() of the ...

How can I make a structure array

If you pass struct() a cell array of data for a field, then it creates a struct array with the same size() as the size() of the ...

6 days ago | 1

Answered

fzero coupled with ode45

fp = @(Op)(1 - (X11.*R) - sqrt(Op.^2 + (X11.*R).^2) - Op./tan(Op)); Opp = fzero(@(Op)fp(Op), [-10 10]); I was sure that I alre...

fzero coupled with ode45

fp = @(Op)(1 - (X11.*R) - sqrt(Op.^2 + (X11.*R).^2) - Op./tan(Op)); Opp = fzero(@(Op)fp(Op), [-10 10]); I was sure that I alre...

6 days ago | 0

Answered

Update app axes in background using parfeval

parallel workers never have access to the display graphics You would need to use a parallel data queue to send values back to...

Update app axes in background using parfeval

parallel workers never have access to the display graphics You would need to use a parallel data queue to send values back to...

6 days ago | 0

Answered

Determine available disk space

Use .NET https://learn.microsoft.com/en-us/dotnet/api/system.io.driveinfo.availablefreespace?view=net-7.0

Determine available disk space

Use .NET https://learn.microsoft.com/en-us/dotnet/api/system.io.driveinfo.availablefreespace?view=net-7.0

6 days ago | 0

Answered

why is my code having an error

the most *common* problem in image importing callbacks, is failing to use fully qualified file names. uigetfile returns two outp...

why is my code having an error

the most *common* problem in image importing callbacks, is failing to use fully qualified file names. uigetfile returns two outp...

6 days ago | 1

Answered

Changing the position of a plot

data1 = rand(1,20); data2 = rand(1,20); figure() ax1 = subplot(2,1,1); plot(data1) ax2 = subplot(2,1,2) plot(data2); ...

Changing the position of a plot

data1 = rand(1,20); data2 = rand(1,20); figure() ax1 = subplot(2,1,1); plot(data1) ax2 = subplot(2,1,2) plot(data2); ...

7 days ago | 0

| accepted

Answered

How can I get matlab back to the state it started in

ensure that there are no files in the userpath (or at least no .m .mlx .mdl .slx .p .mex* .mlapp .project files) delete prefdir...

How can I get matlab back to the state it started in

ensure that there are no files in the userpath (or at least no .m .mlx .mdl .slx .p .mex* .mlapp .project files) delete prefdir...

7 days ago | 0

| accepted

Answered

What are the differences between integral and trapz?

integral() accepts a function handle and is adaptive. Given two endpoints, it examines how steep the function is locally and cho...

What are the differences between integral and trapz?

integral() accepts a function handle and is adaptive. Given two endpoints, it examines how steep the function is locally and cho...

7 days ago | 2

Answered

Write a Matlab program that converts a string (text) message up to 140 characters long into an encrypted message, and then decrypts the message to return the same string. I dont know where I went wrong, any help?

for I=0:size(A) It is a mistake to use single-parameter size() as a bound for a for loop. When you use size() with only a singl...

Write a Matlab program that converts a string (text) message up to 140 characters long into an encrypted message, and then decrypts the message to return the same string. I dont know where I went wrong, any help?

for I=0:size(A) It is a mistake to use single-parameter size() as a bound for a for loop. When you use size() with only a singl...

7 days ago | 0

Answered

Why is my matrix returning a blank output?

A = [1 2 3; 4 5 6; 7 8 9] c = [2 -2 2] [A; c] You can see that for us, the code does run and produce output. I have to wonde...

Why is my matrix returning a blank output?

A = [1 2 3; 4 5 6; 7 8 9] c = [2 -2 2] [A; c] You can see that for us, the code does run and produce output. I have to wonde...

7 days ago | 0

| accepted

Answered

I canĀ“t break the main loop with my code on function file

A break statement can only occur inside a for or while loop. When it is encountered, it causes the termination only of the inner...

I canĀ“t break the main loop with my code on function file

A break statement can only occur inside a for or while loop. When it is encountered, it causes the termination only of the inner...

7 days ago | 1

| accepted

Answered

Custom Matrix Interpolation for every 10 numbers in each column

[Mxrows, Mxcols] = size(Mx); output = interp1(1:Mxrows, interp1(1:Mxcols, Mx.', 1:.1:Mxcols).', 1:.1:Mxrows);

Custom Matrix Interpolation for every 10 numbers in each column

[Mxrows, Mxcols] = size(Mx); output = interp1(1:Mxrows, interp1(1:Mxcols, Mx.', 1:.1:Mxcols).', 1:.1:Mxrows);

7 days ago | 1

Answered

How to change the colorbar limits in Matlab?

'ColorScaling','log','ColorLimits',[10^-5 10^0] When you specify colorscaling log, the colorlimits are the logs of the limits -...

How to change the colorbar limits in Matlab?

'ColorScaling','log','ColorLimits',[10^-5 10^0] When you specify colorscaling log, the colorlimits are the logs of the limits -...

7 days ago | 0

| accepted

Answered

How to bin struct fields based on value in another field?

initials = arrayfun(@(S) S.initial(1), test); finals = [test.final].'; %assuming only one value per entry bins = discretize(i...

How to bin struct fields based on value in another field?

initials = arrayfun(@(S) S.initial(1), test); finals = [test.final].'; %assuming only one value per entry bins = discretize(i...

7 days ago | 0

Answered

Dimensions do not match error during integration

your y is a numeric vector. You cannot use int() or integrate() with numeric vectors. You have y*cos() of something involving...

Dimensions do not match error during integration

your y is a numeric vector. You cannot use int() or integrate() with numeric vectors. You have y*cos() of something involving...

7 days ago | 0

Answered

how to generate code from a .mat file data?

This is not possible in the general case. It is possible to have saved objects for which there is no public method to recreate t...

how to generate code from a .mat file data?

This is not possible in the general case. It is possible to have saved objects for which there is no public method to recreate t...

7 days ago | 0

| accepted

Answered

how can I write this in a compact form? can anyone suggest a single line code for it

https://www.mathworks.com/help/matlab/ref/toeplitz.html#buxdtu9 circulant matrix Or you could add two diagonal matrices

how can I write this in a compact form? can anyone suggest a single line code for it

https://www.mathworks.com/help/matlab/ref/toeplitz.html#buxdtu9 circulant matrix Or you could add two diagonal matrices

7 days ago | 0