Answered

Splash Screen not working, compiled using 2014b

I guess I figured out the reason (not the solution though). The splash screen does not work if the windows console is activated ...

Splash Screen not working, compiled using 2014b

I guess I figured out the reason (not the solution though). The splash screen does not work if the windows console is activated ...

mer än 5 år ago | 0

Question

Splash Screen not working, compiled using 2014b

I created a compiled application using Matlab 2014b. I found out that since MATLAB 2014a, the compiler includes a splash screen ...

mer än 5 år ago | 2 answers | 0

Question

Accessing Documentation issue online

I am part of a university and use Matlab from university. I have been trying to access documentation related to compiler (2014b ...

mer än 5 år ago | 1 answer | 0

Question

Mex speed slower on linux than Windows

I have been trying to use mex to speed up some of my functions. I was surprised that running the same compiled mex code on windo...

mer än 5 år ago | 1 answer | 0

Answered

How to store value of rand() function in a file?

You can use fprintf - very nicely explained here with examples - http://www.mathworks.com/help/matlab/ref/fprintf.html

How to store value of rand() function in a file?

You can use fprintf - very nicely explained here with examples - http://www.mathworks.com/help/matlab/ref/fprintf.html

mer än 5 år ago | 0

| accepted

Answered

how to plot a straight line of the form y=w1*x1+w2*x2 in matlab

Y = w1*x1 + w2*x2; I am not sure what is you independent variable (For example, you plot y as a function of x but here you ...

how to plot a straight line of the form y=w1*x1+w2*x2 in matlab

Y = w1*x1 + w2*x2; I am not sure what is you independent variable (For example, you plot y as a function of x but here you ...

mer än 5 år ago | 0

Answered

How to put values to zero within a specified range?

Lets say your data variable is A then: A(A>-0.5 & A < 0.5) = 0;

How to put values to zero within a specified range?

Lets say your data variable is A then: A(A>-0.5 & A < 0.5) = 0;

mer än 5 år ago | 0

Answered

Using a for loop for legend plots

Z=[3 1 7]; for i=1:length(Z) A(i)=Z(i)+2; B(i)=Z(i)-7; C(i)=Z(i)+4; ...

Using a for loop for legend plots

Z=[3 1 7]; for i=1:length(Z) A(i)=Z(i)+2; B(i)=Z(i)-7; C(i)=Z(i)+4; ...

mer än 5 år ago | 0

| accepted

Answered

Using a function instead of inlining increases the time it takes to run

The issue is in subfunction function B = sortB(B,new_entry) B = sort([ B ; new_entry ]); end You are ...

Using a function instead of inlining increases the time it takes to run

The issue is in subfunction function B = sortB(B,new_entry) B = sort([ B ; new_entry ]); end You are ...

mer än 5 år ago | 1

| accepted

Answered

sub plotting odes15 in MATLAB

You have done most of it already. Now to call ode15s, you should do like this : [T,X] = ode15s(@problem1,[0 60*24],[4.5 15...

sub plotting odes15 in MATLAB

You have done most of it already. Now to call ode15s, you should do like this : [T,X] = ode15s(@problem1,[0 60*24],[4.5 15...

mer än 5 år ago | 0

Answered

How to graphically represent 3D array

Lets say you have a 3D matrix with m x n x k size. Then: [X,Y,Z] = meshgrid(1:m,1:n,1:k); plot3(X(A == 1),Y(A == 1),Z...

How to graphically represent 3D array

Lets say you have a 3D matrix with m x n x k size. Then: [X,Y,Z] = meshgrid(1:m,1:n,1:k); plot3(X(A == 1),Y(A == 1),Z...

mer än 5 år ago | 1

| accepted

Answered

unknown parameters differential equation

The issue here is that you have 3 parameters and 2 equations, so there might not exist an unique solution. However if there exis...

unknown parameters differential equation

The issue here is that you have 3 parameters and 2 equations, so there might not exist an unique solution. However if there exis...

mer än 5 år ago | 1

| accepted

Question

Speeding Up Logical Operations

Hi Guys, I am trying to uses the function below function coords = distancePerBound(coords,L) hL = L/2; coords(...

mer än 5 år ago | 2 answers | 0

Question

Seeding RNG in MEX function

Hi guys, I recently started to learn MEX to improve the speed on some of my code. As I deal with a lot of Monte Carlo simulat...

ungefär 6 år ago | 1 answer | 0

Answered

Using RK4 numerically rather than using an ODE solver

The problem is similar to your previous post ( http://www.mathworks.com/matlabcentral/answers/115341-euler-method-without-using-...

Using RK4 numerically rather than using an ODE solver

The problem is similar to your previous post ( http://www.mathworks.com/matlabcentral/answers/115341-euler-method-without-using-...

mer än 6 år ago | 2

| accepted

Answered

Euler Method without using ODE solvers such as ode45

Given the equation:y' + 2y = 2 - 1e-4t The approximation will be: y(t+h) = y(t) +h*(- 2*y(t)+ 2 - e(-4t)) To write this: *E...

Euler Method without using ODE solvers such as ode45

Given the equation:y' + 2y = 2 - 1e-4t The approximation will be: y(t+h) = y(t) +h*(- 2*y(t)+ 2 - e(-4t)) To write this: *E...

mer än 6 år ago | 0

| accepted

Answered

how to use fmincon in a loop

A = [5 0 2 0 1; 0 1 3 7 0; 5 0 1 0 2; 0 1 0 3 9]; b = [-1;-10;-3;-10]; FF = @(x) norm(A*x+b); xx = ...

how to use fmincon in a loop

A = [5 0 2 0 1; 0 1 3 7 0; 5 0 1 0 2; 0 1 0 3 9]; b = [-1;-10;-3;-10]; FF = @(x) norm(A*x+b); xx = ...

mer än 6 år ago | 0

| accepted

Answered

Nested if/else loop not stepping through all steps; why?

The interest rates are calculated right. The issue is that 0.015 gets hidden as 0.01. Try this instead of disp: fprintf(...

Nested if/else loop not stepping through all steps; why?

The interest rates are calculated right. The issue is that 0.015 gets hidden as 0.01. Try this instead of disp: fprintf(...

mer än 6 år ago | 0

| accepted

Answered

Multiple linear regression with constraint

Use lsqlin ( http://www.mathworks.com/help/optim/ug/lsqlin.html )

Multiple linear regression with constraint

Use lsqlin ( http://www.mathworks.com/help/optim/ug/lsqlin.html )

mer än 6 år ago | 0

| accepted

Answered

Storing values in a for loop when input vector is not used in calculation

Monthly=50; Months=[1:12]; Balance=0; disp('MONTH MONTH-END BALANCE') for k=1:length(Months) Balance=(Balance...

Storing values in a for loop when input vector is not used in calculation

Monthly=50; Months=[1:12]; Balance=0; disp('MONTH MONTH-END BALANCE') for k=1:length(Months) Balance=(Balance...

mer än 6 år ago | 0

| accepted

Answered

what is the meaning of code?

If this code runs, D must be a scalar or a matrix in digit0. digitdata = [digitdata;D] appends the matrix or vector digi...

what is the meaning of code?

If this code runs, D must be a scalar or a matrix in digit0. digitdata = [digitdata;D] appends the matrix or vector digi...

mer än 6 år ago | 0

| accepted

Answered

Coordinates elements and distance

temp = find(val>0); cord_new = coordinate(:,temp+1); distx = (((cord_new(1,:) - coordinate(1,1)).^2) + ((cord_new(2,:) -...

Coordinates elements and distance

temp = find(val>0); cord_new = coordinate(:,temp+1); distx = (((cord_new(1,:) - coordinate(1,1)).^2) + ((cord_new(2,:) -...

mer än 6 år ago | 0

| accepted

Answered

Matlab question about code

[righe_d, colonne_d]= size(D_pre) coordinate=zeros(2, colonne_d) for i=1:colonne_d coordinate(:,i)=D_pre(:,i) ...

Matlab question about code

[righe_d, colonne_d]= size(D_pre) coordinate=zeros(2, colonne_d) for i=1:colonne_d coordinate(:,i)=D_pre(:,i) ...

mer än 6 år ago | 0

| accepted

Answered

"input of argument types 'double'" meaning?

Double is the type of precision Matlab store numeric values in (unless specified). http://www.mathworks.com/help/matlab/matl...

"input of argument types 'double'" meaning?

Double is the type of precision Matlab store numeric values in (unless specified). http://www.mathworks.com/help/matlab/matl...

mer än 6 år ago | 0

| accepted

Answered

ode45 on a system of differential equations with vectors as variables

function xprime = diffs(t,x) rho = 0.0001; len_xx = numel(x); xprime = zeros(len_xx,1); xprime(1:len_xx/2) = -...

ode45 on a system of differential equations with vectors as variables

function xprime = diffs(t,x) rho = 0.0001; len_xx = numel(x); xprime = zeros(len_xx,1); xprime(1:len_xx/2) = -...

mer än 6 år ago | 0

| accepted

Question

Why the preallocated matrix perform slower in the case below?

I have a situation where I have to create a matrix and do some analysis on it. However the matrix size changes frequently. I tho...

mer än 6 år ago | 2 answers | 0

Answered

For a beginning Matlab plotting project instructions are to use several commands. I used everything except for "subplot" and "hold". Can anyone tell me how I could work it into the following code?:

subplot sections a figure windows in sections For example, subplot(3,2,1) Suggest that the figure space is going to be d...

For a beginning Matlab plotting project instructions are to use several commands. I used everything except for "subplot" and "hold". Can anyone tell me how I could work it into the following code?:

subplot sections a figure windows in sections For example, subplot(3,2,1) Suggest that the figure space is going to be d...

mer än 6 år ago | 1

| accepted

Answered

how to save multiple images with different names?

I think one way to do this will by using an identifier taken from the original file name. Otherwise filename = sprintf('Fea...

how to save multiple images with different names?

I think one way to do this will by using an identifier taken from the original file name. Otherwise filename = sprintf('Fea...

mer än 6 år ago | 0

Answered

For loop, two variables

dT = zeros(100,1); % Initalize dT(1,1) = 0.35; for j = 2:100 dT(j,1) = dT(j-1,1)*j; end plot(dT); The rea...

For loop, two variables

dT = zeros(100,1); % Initalize dT(1,1) = 0.35; for j = 2:100 dT(j,1) = dT(j-1,1)*j; end plot(dT); The rea...

mer än 6 år ago | 0

| accepted