Risposto
how to interrupt a while loop??
In your GUI, set some user data to your GUI handle. In your loop, check this data and |break| accordingly.

quasi 12 anni fa | 0

Risposto
remove rows with all zeros
Search facility on Answers shows this question is asked a lot... Here's one of the more recent. <http://www.mathworks.com/ma...

quasi 12 anni fa | 0

Risposto
Question on optimization problem and fminsearch,fminunc,lsqnonlin
Depending on how localised your minima are, you can sometimes get around this with a simplex-based solver like |fminsearch|. I ...

quasi 12 anni fa | 0

Risposto
How to set manually training and test data for training a neural network
Read this: <http://www.mathworks.com/help/nnet/ug/divide-data-for-optimal-neural-network-training.html> You want the |divi...

quasi 12 anni fa | 1

| accettato

Risposto
Probably because you're asking it to read integers (%d), not floats (%f). Make that change. Also, beware of MatLab's |fscanf...

quasi 12 anni fa | 0

| accettato

Risposto
for and parfor
That's a thought-provoking question. "Faster" is not always a requirement in computing. Also, there are many algorithms or s...

quasi 12 anni fa | 0

| accettato

Risposto
Add a colum and a row of blank (white) values in an Image
Your best options (as far as I know) are: 1. Resize the image twice (once for new row, once for new column) im(end+1, :)...

quasi 12 anni fa | 1

Risposto
Fitting data with two peaks
Define a function that accepts the parameters of the two lorenzian curves and computes the full curve. I don't know how many ...

quasi 12 anni fa | 2

Risposto
Change Secod Axis Color And Tick Label Colors
set(haxes(2), 'YColor', 'r');

quasi 12 anni fa | 2

Risposto
Renumber an axis of a figure
You can replace the 'XTick' member of the axis. Here, I just use the handle to the current axis. x = 0:1.224:10; y = ra...

quasi 12 anni fa | 0

| accettato

Risposto
Creating a desktop shortcut to run an mfile, Windows 7
A batch file to do this is almost exactly the same as a shortcut. You still need to know the MatLab install path. Now, I did a...

quasi 12 anni fa | 0

| accettato

Risposto
Function using for loop
There's a pattern here... state1 = max( ceil(x(1) / 5), 1 ); state2 = max( ceil(x(2) / 5), 1 ); Just as a point on st...

quasi 12 anni fa | 0

Risposto
Leaving a blank line between inputs
input('\nsome question :', 's')

quasi 12 anni fa | 1

| accettato

Risposto
delete zeros rows and columns
Yeah you did too much! % Remove zero rows data( all(~data,2), : ) = []; % Remove zero columns data( :, all(~data...

quasi 12 anni fa | 10

Risposto
String parsing
It kinda depends on how flexible you need to be. Are the tags ever in a different order? Is the format EXACTLY as given? Are ...

quasi 12 anni fa | 1

| accettato

Risposto
Transfer a matrix in a quick way
If you want to preserve each 4x3 block, you could try something like this: B = reshape(A(:, [1:3:end, 2:3:end, 3:3:end]), [...

quasi 12 anni fa | 0

| accettato

Risposto
Anyone using MATLAB on a LINUX OS??
MatLab directly supports many Linux flavours, including Red Hat: <http://www.mathworks.com/support/sysreq/current_release/linux....

quasi 12 anni fa | 0

Risposto
divide and conquer
<http://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm>

quasi 12 anni fa | 0

Risposto
Stop the for loop
Time for the most basic of debugging practises... After you calculate j, put in the following line of code: disp(j); ...

quasi 12 anni fa | 1

| accettato

Risposto
Uncorrelated sinuoids
By 'uncorrelated', you just mean out-of-phase, right? This is about as simple as wave generation gets. Just work out how muc...

quasi 12 anni fa | 0

Risposto
Detect a human figure in a live video
Employ a 2 year-old child to sit in front of the screen and "point at the person". This solution is 100% accurate with absolu...

quasi 12 anni fa | 0

Risposto
summation inside a "for loop"
I would expect this to work: B = zeros(length(q), size(A,2)); for j = 1:length(q) B(j,:) = sum( exp(q(j)*A) ); e...

quasi 12 anni fa | 0

| accettato

Risposto
Image acquisition-skipping frames
Those images are 512 * 512 * 1 ? That's 256kB. These are small. What is your frame rate? I'll assume 50 fps. That's 12.5 MB...

quasi 12 anni fa | 0

Risposto
needs to get projection of one point from one x-axis to another
Have I understood correctly? You have |xred| and |xmag| which are two different ranges. You want to translate the x-coord from...

quasi 12 anni fa | 0

Risposto
Arrays of structures indexing
Start by working out which structures had a result: bValid = ~cellfun( @isempty, ind ); Now, you need to find the row in...

quasi 12 anni fa | 0

Risposto
sorting columns with empty cells
You don't _have_ to use |datenum| to sort this data - I find |datenum| too slow and I generally avoid it. I prefer to represent...

quasi 12 anni fa | 0

Risposto
How to generate 0 and 1 with equal probability using 'randi' function?
You did it backwards. Do this: nums = randi([0 1], M, N) Please note that while there is equal probability of randomly ...

quasi 12 anni fa | 7

| accettato

Risposto
calculate the Coding delay
Do this: tic doStuffThatYouWantToTime(); toc

quasi 12 anni fa | 1

| accettato

Risposto
Matlab simplify boolean expression
The expression: (A && B) || (A && ~B) Is logically equivalent to: A The reason is that both terms require |A| to...

quasi 12 anni fa | 1

Risposto
Efficiently populating an array without for loops
Hah... So an alternative in Order(N) time... for n = 1:size(MyData,1) row = MyData(n, [1,2,3]); ObjectTypes(row(...

quasi 12 anni fa | 0

| accettato