Answered

Slider for Multiple Plots in GUIDE

Something very similar that I've found helpful is available at <http://www.mathworks.com/matlabcentral/fileexchange/5253-scro...

Slider for Multiple Plots in GUIDE

Something very similar that I've found helpful is available at <http://www.mathworks.com/matlabcentral/fileexchange/5253-scro...

nästan 10 år ago | 0

Answered

Can I Use the Special Function Keys to Interrupt a Script?

Ctrl+C will kill a running script/function

Can I Use the Special Function Keys to Interrupt a Script?

Ctrl+C will kill a running script/function

nästan 10 år ago | 0

Answered

Accessing cell array via factor/index

You're pretty close in your attempt; it's tricky with the cell indexing and without using strcmp. How about trying this % ...

Accessing cell array via factor/index

You're pretty close in your attempt; it's tricky with the cell indexing and without using strcmp. How about trying this % ...

nästan 10 år ago | 0

| accepted

Answered

Dimension mismatch for using Runge Kutta 4 order methods

If dx/dt = [0,0,.4,0] for a vector x, then the exact solution is x(t) = [x0, x1, 0.4*t+x2, x3] where x0,x1,x2,x3 are initi...

Dimension mismatch for using Runge Kutta 4 order methods

If dx/dt = [0,0,.4,0] for a vector x, then the exact solution is x(t) = [x0, x1, 0.4*t+x2, x3] where x0,x1,x2,x3 are initi...

nästan 10 år ago | 0

Answered

IQ test, why does matlab see different answers?

Your inner loop should run from j = 1:c not j = i:c

IQ test, why does matlab see different answers?

Your inner loop should run from j = 1:c not j = i:c

ungefär 10 år ago | 2

| accepted

Answered

std of a logical matrix

From <http://www.mathworks.com/matlabcentral/answers/43567-standard-deviation-of-a-3-d-matrix> sigmasPositive = zeros(1,4...

std of a logical matrix

From <http://www.mathworks.com/matlabcentral/answers/43567-standard-deviation-of-a-3-d-matrix> sigmasPositive = zeros(1,4...

ungefär 10 år ago | 1

| accepted

Answered

Standard deviation of a 3-d matrix

If y is 200-by-1-by-4, you can get rid of the singleton dimension using y2D = squeeze(y); then compute the 4 different s...

Standard deviation of a 3-d matrix

If y is 200-by-1-by-4, you can get rid of the singleton dimension using y2D = squeeze(y); then compute the 4 different s...

ungefär 10 år ago | 1

| accepted

Answered

How can I create image from 2d matrix?

As a first attempt, try replacing image with imagesc which scales the colormap to the range of values in the ma...

How can I create image from 2d matrix?

As a first attempt, try replacing image with imagesc which scales the colormap to the range of values in the ma...

ungefär 10 år ago | 0

Answered

Error while trying to code the Newton Method for a System of Equations

The first time you enter the while loop, you are comparing scalars (assuming the input TOL is a scalar). However, when you over...

Error while trying to code the Newton Method for a System of Equations

The first time you enter the while loop, you are comparing scalars (assuming the input TOL is a scalar). However, when you over...

ungefär 10 år ago | 1

Answered

Deleting zeros and NaN in a matrix

Try A(any(isnan(A),2)|any(A==0,2),:) = []

Deleting zeros and NaN in a matrix

Try A(any(isnan(A),2)|any(A==0,2),:) = []

ungefär 10 år ago | 3

Answered

Use cells rather than matrices to sort a matrix into 255 separate lists

If I understand your question, the following may help % create array like yours... n-by-5, last column has index of "bin" w...

Use cells rather than matrices to sort a matrix into 255 separate lists

If I understand your question, the following may help % create array like yours... n-by-5, last column has index of "bin" w...

ungefär 10 år ago | 0

| accepted

Answered

Set current figure without making it visible

Perhaps figure(myPicture), set(myPicture,'visible','off') then when you want set(myPicture,'visible','on')

Set current figure without making it visible

Perhaps figure(myPicture), set(myPicture,'visible','off') then when you want set(myPicture,'visible','on')

ungefär 10 år ago | 0

Answered

disp some number with loop for

If you need the number of zeros before the decimal place and after to be exactly as you indicated in the original question, try ...

disp some number with loop for

If you need the number of zeros before the decimal place and after to be exactly as you indicated in the original question, try ...

ungefär 10 år ago | 1

Answered

loop for clock in MATLAB

Try running this script... It has some ideas you might use, but it is hardly optimal. startTimeString = '12:00'; stopTi...

loop for clock in MATLAB

Try running this script... It has some ideas you might use, but it is hardly optimal. startTimeString = '12:00'; stopTi...

ungefär 10 år ago | 0

Answered

Is there a way to linearly interpolate dates and times?

If you convert the dates to serial date numbers as the cyclist suggests, then you might be able to benefit from this example... ...

Is there a way to linearly interpolate dates and times?

If you convert the dates to serial date numbers as the cyclist suggests, then you might be able to benefit from this example... ...

ungefär 10 år ago | 1

| accepted

Answered

How to overwrite some workspace variables in a dynamic program?

Both ideas are good. If 2. doesn't work, try clear('var_name') or clear var_name

How to overwrite some workspace variables in a dynamic program?

Both ideas are good. If 2. doesn't work, try clear('var_name') or clear var_name

ungefär 10 år ago | 0

| accepted

Answered

eliminating, whenever is necessary the first column in nun where [num,txt,raw]=xlsread('data.xlsx');

I like your approach. try if all (isnan(num(:,1)) | num(:,1) == 0) num(:,1) = []; end note that there may s...

eliminating, whenever is necessary the first column in nun where [num,txt,raw]=xlsread('data.xlsx');

I like your approach. try if all (isnan(num(:,1)) | num(:,1) == 0) num(:,1) = []; end note that there may s...

ungefär 10 år ago | 0

| accepted

Answered

How can't a matrix be generated randomly?

If I understand you correctly, each column represents a different trial. What does the iteration variable n (going from 1 to 2....

How can't a matrix be generated randomly?

If I understand you correctly, each column represents a different trial. What does the iteration variable n (going from 1 to 2....

ungefär 10 år ago | 0

| accepted

Answered

treating NaN as a unique value (instead of as a distinct)

Write this function... function y = myUnique(x) y = unique(x); if any(isnan(y)) y(isnan(y)) = []; % remove...

treating NaN as a unique value (instead of as a distinct)

Write this function... function y = myUnique(x) y = unique(x); if any(isnan(y)) y(isnan(y)) = []; % remove...

ungefär 10 år ago | 1

| accepted

Answered

look for partial variable name match

I assume that by "a string arrays of names" you mean a cell, call it C, whose contents are strings. For example, something like...

look for partial variable name match

I assume that by "a string arrays of names" you mean a cell, call it C, whose contents are strings. For example, something like...

ungefär 10 år ago | 0

Answered

When to accept an answer for someone

Such functionality should not have been implemented, IMO.

When to accept an answer for someone

Such functionality should not have been implemented, IMO.

ungefär 10 år ago | 1

Answered

How do you make a callable object?

The following class can be used to create a callable object. The key is to overload the subsref function with a class method. ...

How do you make a callable object?

The following class can be used to create a callable object. The key is to overload the subsref function with a class method. ...

ungefär 10 år ago | 2

Answered

Adding up sizes of cell arrays

I assume you have a 1-by-NumberOfClasses cell array called CellArray. Furthermore, I assume that each element of CellArray c...

Adding up sizes of cell arrays

I assume you have a 1-by-NumberOfClasses cell array called CellArray. Furthermore, I assume that each element of CellArray c...

ungefär 10 år ago | 2

Answered

How to access specific data when using "getfield"

If I understand your question, this may work... for i=1:10; myData(:,i) = getfield(Charge,strcat('Curve',int2str(i)));...

How to access specific data when using "getfield"

If I understand your question, this may work... for i=1:10; myData(:,i) = getfield(Charge,strcat('Curve',int2str(i)));...

ungefär 10 år ago | 1

Answered

[Num,Txt,Raw]=xlsread......

To convert cell to matrix use the cell2mat functions. For example, mean(cell2mat(Raw(:,7)))

[Num,Txt,Raw]=xlsread......

To convert cell to matrix use the cell2mat functions. For example, mean(cell2mat(Raw(:,7)))

ungefär 10 år ago | 1

Answered

Deleting multiple cell rows after using uiimport

If C is a cell, delete rows j through k using C(j:k,:) = []; % note use of parentheses and not braces to index

Deleting multiple cell rows after using uiimport

If C is a cell, delete rows j through k using C(j:k,:) = []; % note use of parentheses and not braces to index

ungefär 10 år ago | 1

| accepted

Answered

Combine arrays

@Sean's answer is great. (That's my vote up there...) To suggest other ways to plot arrays on the same axis, try Approa...

Combine arrays

@Sean's answer is great. (That's my vote up there...) To suggest other ways to plot arrays on the same axis, try Approa...

ungefär 10 år ago | 0

| accepted

Answered

Loop / Repeat if random number = 0

Try n = round(200*rand); while (n == 0) n = round(200*rand); end Or, even better, n = randi(200); % gene...

Loop / Repeat if random number = 0

Try n = round(200*rand); while (n == 0) n = round(200*rand); end Or, even better, n = randi(200); % gene...

ungefär 10 år ago | 1

| accepted

Answered

How can i calculate e^A*t

Use the expm function for computing a matrix exponential

How can i calculate e^A*t

Use the expm function for computing a matrix exponential

ungefär 10 år ago | 9

Answered

Deleting similar rows in Matrices contained in cell

If I understand your objective, try the following arrayOfElements = ['a','b','c','d']; % your initial array indicesOfUni...

Deleting similar rows in Matrices contained in cell

If I understand your objective, try the following arrayOfElements = ['a','b','c','d']; % your initial array indicesOfUni...

ungefär 10 år ago | 0