Question

Issues exiting from a while loop when the figure is closed

I often need to make functions that can be terminated by a user who doesn't have access to the keyboard (and thus the all-powerf...

mer än 9 år ago | 2 answers | 1

Answered

Is there any way of producing a 4d plot from a matrix which has 4 columns (coordinates + value)?

It's generally difficult to provide an intuitive graphical representation of high dimensional data. But, and mind you I say this...

Is there any way of producing a 4d plot from a matrix which has 4 columns (coordinates + value)?

It's generally difficult to provide an intuitive graphical representation of high dimensional data. But, and mind you I say this...

mer än 9 år ago | 0

Answered

How to speed up normalization of an array

You don't have to use bsxfun three times in that line, just the once. Try this simpler line: selfn = bsxfun(@rdivide,selfn,...

How to speed up normalization of an array

You don't have to use bsxfun three times in that line, just the once. Try this simpler line: selfn = bsxfun(@rdivide,selfn,...

mer än 9 år ago | 0

Answered

Multiple vector output in a function

You need to specify that you want *both* outputs: [X,Y] = element_select(A,B,astart,astep,bstart,bstep) X = 1 ...

Multiple vector output in a function

You need to specify that you want *both* outputs: [X,Y] = element_select(A,B,astart,astep,bstart,bstep) X = 1 ...

mer än 9 år ago | 1

| accepted

Answered

How do i know a 'cancel' button or the 'cross' button is pressed in inputdlg?

You could do this by checking whether the output of the function is empty: answer = inputdlg('enter your name'); user_ca...

How do i know a 'cancel' button or the 'cross' button is pressed in inputdlg?

You could do this by checking whether the output of the function is empty: answer = inputdlg('enter your name'); user_ca...

mer än 9 år ago | 0

| accepted

Answered

how to find maximum value from a matrix then add a value to it and then replace that in the same matrix?

This ought to do the job! a=rand(4,10); a(a==max(a(:))) = a(a==max(a(:)))+0.001;

how to find maximum value from a matrix then add a value to it and then replace that in the same matrix?

This ought to do the job! a=rand(4,10); a(a==max(a(:))) = a(a==max(a(:)))+0.001;

mer än 9 år ago | 1

| accepted

Answered

Assigning a vector to multiple rows of a matrix

You could try using indices instead of subscripts: %pick the rows in B you want to your A values to go into: r = [1 3 5]...

Assigning a vector to multiple rows of a matrix

You could try using indices instead of subscripts: %pick the rows in B you want to your A values to go into: r = [1 3 5]...

mer än 9 år ago | 0

| accepted

Answered

Repeative selecting unique values of matrix

Ok, now I understand what you're trying to do. The first three values will always be the first three three from user 1, then the...

Repeative selecting unique values of matrix

Ok, now I understand what you're trying to do. The first three values will always be the first three three from user 1, then the...

mer än 9 år ago | 0

Answered

Repeative selecting unique values of matrix

You don't really need the three vectors to begin with, you can make a matrix containing a random permutation (randperm.m) of the...

Repeative selecting unique values of matrix

You don't really need the three vectors to begin with, you can make a matrix containing a random permutation (randperm.m) of the...

mer än 9 år ago | 0

Answered

How can I (for a digital signal) estimate the interval between steps of amplitude 1?

The code you've included doesn't work because we don't know what the variable 'step' is defined as. You might have more luck fir...

How can I (for a digital signal) estimate the interval between steps of amplitude 1?

The code you've included doesn't work because we don't know what the variable 'step' is defined as. You might have more luck fir...

mer än 9 år ago | 0

| accepted

Answered

pad vector between its values

If you find regular array operations more straightforward to follow than cell functions, you could create an array that increase...

pad vector between its values

If you find regular array operations more straightforward to follow than cell functions, you could create an array that increase...

mer än 9 år ago | 1

| accepted

Answered

Simulating a random sample from a matrix

So for each row you want to randomly pick either the first or the second column, correct? This would result in 88 total values t...

Simulating a random sample from a matrix

So for each row you want to randomly pick either the first or the second column, correct? This would result in 88 total values t...

mer än 9 år ago | 0

Answered

How can i index various objects using a variable in their name?

You can dynamically refer to different edit boxes by enclosing the field name in parentheses and supplying the numerical argumen...

How can i index various objects using a variable in their name?

You can dynamically refer to different edit boxes by enclosing the field name in parentheses and supplying the numerical argumen...

mer än 9 år ago | 1

| accepted

Answered

time user input as soon as they start typing

Per is exactly right, this sort of a question calls for the use of the KeyPressFcn. The idea is to make a figure that waits f...

time user input as soon as they start typing

Per is exactly right, this sort of a question calls for the use of the KeyPressFcn. The idea is to make a figure that waits f...

nästan 10 år ago | 0

Answered

Extract length of data in a structure

If you are intent on avoiding a for-loop, then you could try converting the structure to a cell array and then using a cell ...

Extract length of data in a structure

If you are intent on avoiding a for-loop, then you could try converting the structure to a cell array and then using a cell ...

nästan 10 år ago | 0

Answered

Shuffle vector with constraints

A brute force method works fairly well in this scenario - 1) start with a shuffled version of the sequence, 2) find repeats, 3) ...

Shuffle vector with constraints

A brute force method works fairly well in this scenario - 1) start with a shuffled version of the sequence, 2) find repeats, 3) ...

nästan 10 år ago | 1

| accepted

Answered

Shadowing built-in functions

I've always taken a stupidly simple approach to this problem: I just type what I am planning to name the variable into the comma...

Shadowing built-in functions

I've always taken a stupidly simple approach to this problem: I just type what I am planning to name the variable into the comma...

nästan 10 år ago | 1

Answered

find closest Coordinates to a point

In your example, you are returning A, rather than the closest point in B... assuming that the answer you are looking for was act...

find closest Coordinates to a point

In your example, you are returning A, rather than the closest point in B... assuming that the answer you are looking for was act...

ungefär 10 år ago | 8

| accepted

Answered

convert a range vector of bin centers to bin edges. Bin Centers and edges are non-uniform

If we assume the simplest case, that the edges should be precisely between the centres (i.e., not geometric, or logarithmic, etc...

convert a range vector of bin centers to bin edges. Bin Centers and edges are non-uniform

If we assume the simplest case, that the edges should be precisely between the centres (i.e., not geometric, or logarithmic, etc...

ungefär 10 år ago | 0

Answered

indexing a vector by a power

You could accomplish this without using a for loop as follows: n = 4; p = 2.^cumprod([1,2+zeros(1,n-1)]) this results...

indexing a vector by a power

You could accomplish this without using a for loop as follows: n = 4; p = 2.^cumprod([1,2+zeros(1,n-1)]) this results...

ungefär 10 år ago | 1

| accepted

Answered

Range of atan2, confusion when using coordinates of a photo

You'll need to subtract the XY centre of your image from the points before you measure the angle using atan2. The following code...

Range of atan2, confusion when using coordinates of a photo

You'll need to subtract the XY centre of your image from the points before you measure the angle using atan2. The following code...

ungefär 10 år ago | 0

Answered

how to insert noise in a sine function.

Provided what you are looking for is white noise, then Image Analyst's solution: noisy_y = y + noiseAmplitude * rand(1, l...

how to insert noise in a sine function.

Provided what you are looking for is white noise, then Image Analyst's solution: noisy_y = y + noiseAmplitude * rand(1, l...

ungefär 10 år ago | 0

Answered

Remote start/stop Vicon Nexus Motion Capture from a separate computer.

As far as I know, what you are asking for is not something that the ViconDataStreamSDK actually does. What the SDK _can_ do is r...

Remote start/stop Vicon Nexus Motion Capture from a separate computer.

As far as I know, what you are asking for is not something that the ViconDataStreamSDK actually does. What the SDK _can_ do is r...

ungefär 10 år ago | 1

Submitted

Adaptive Track Engine

Determines what changes you should make to the signal during a psychoacoustic adaptive track.

mer än 10 år ago | 1 download |

Submitted

Kautz sequence generator

Generates example Kautz sequences of specified number of characters and subsequence lengths.

mer än 12 år ago | 1 download |

Submitted

de Bruijn sequence generator

Generates example de Bruijn sequences of specified number of characters and subsequence lengths.

mer än 12 år ago | 2 downloads |

Submitted

latin cube

This function will compute a randomized example latin cube of size N.

mer än 13 år ago | 2 downloads |