378 total contributions since 2012

I use MATLAB for small jobs and C++ for real jobs.

Professional Interests: Problem solving

Answered

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...

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...

plus de 5 ans ago | 0

| accepted

Answered

Help with proper parfor

You can't write to a parallel-segmented matrix in the inner loop. Try this: parfor i=1:r col = zeros(n,1); f...

Help with proper parfor

You can't write to a parallel-segmented matrix in the inner loop. Try this: parfor i=1:r col = zeros(n,1); f...

environ 7 ans ago | 0

| accepted

Answered

How can I import a .txt file correctly using textscan?

The way to have the most control over a line-based txt file import is to read it one line at a time: while !feof(fid) ...

How can I import a .txt file correctly using textscan?

The way to have the most control over a line-based txt file import is to read it one line at a time: while !feof(fid) ...

environ 7 ans ago | 1

Answered

Script adapted into a funtion Function not returning equal values

Floating point precision errors. If you need to test for zero, then test for something like: if abs(value) < 1e-5 10^-5 ...

Script adapted into a funtion Function not returning equal values

Floating point precision errors. If you need to test for zero, then test for something like: if abs(value) < 1e-5 10^-5 ...

plus de 7 ans ago | 0

| accepted

Answered

time to number conversion

From memory, if you use |datenum| to just get the time with no date, it doesn't return a number between 0 and 1. But you can ge...

time to number conversion

From memory, if you use |datenum| to just get the time with no date, it doesn't return a number between 0 and 1. But you can ge...

plus de 7 ans ago | 0

| accepted

Answered

Do you think that MATLAB is expensive?

Yes, I think it is expensive. In New Zealand, it's about $2000 per toolbox. The compiler is over $8000. The work I was doin...

Do you think that MATLAB is expensive?

Yes, I think it is expensive. In New Zealand, it's about $2000 per toolbox. The compiler is over $8000. The work I was doin...

plus de 7 ans ago | 0

Answered

Can you use cell or struct as function input？

Yes, and yes. I'm puzzled that you're asking this here when you could quite easily test for yourself... Part of the process ...

Can you use cell or struct as function input？

Yes, and yes. I'm puzzled that you're asking this here when you could quite easily test for yourself... Part of the process ...

plus de 7 ans ago | 2

| accepted

Answered

Save data from a loop

I think this might be what you want: for f = 1:40 for g = 1:40 i = (f-1) * 40 + g; dpTxcouple1(:,:,i) = ...

Save data from a loop

I think this might be what you want: for f = 1:40 for g = 1:40 i = (f-1) * 40 + g; dpTxcouple1(:,:,i) = ...

plus de 7 ans ago | 0

Answered

Answering my own question

If it really is about something cool, then I'm in agreement with the others. Go for it... People could still add their own ans...

Answering my own question

If it really is about something cool, then I'm in agreement with the others. Go for it... People could still add their own ans...

plus de 7 ans ago | 0

Answered

can someone explain this code?

|x1_Y| is an array of indices. You're doing a boolean test on |x1(10:300)| to determine if a point is an outlier. That is, it ...

can someone explain this code?

|x1_Y| is an array of indices. You're doing a boolean test on |x1(10:300)| to determine if a point is an outlier. That is, it ...

plus de 7 ans ago | 0

| accepted

Answered

Need some assistance with "if" command

Oh, the better way is to use the proper MATLAB error function: if a < 0 error( 'Not a valid input.' ); end

Need some assistance with "if" command

Oh, the better way is to use the proper MATLAB error function: if a < 0 error( 'Not a valid input.' ); end

plus de 7 ans ago | 0

Answered

Need some assistance with "if" command

If you don't have a function or anything to return from, there's a sneaky little trick you can use. This can be useful for othe...

Need some assistance with "if" command

If you don't have a function or anything to return from, there's a sneaky little trick you can use. This can be useful for othe...

plus de 7 ans ago | 0

| accepted

Answered

As a Software Engineer, Why should I use MATLAB?

From one developer to another, the answer is: *why not??* What do you have to lose from having another tool (or rather, arsen...

As a Software Engineer, Why should I use MATLAB?

From one developer to another, the answer is: *why not??* What do you have to lose from having another tool (or rather, arsen...

plus de 7 ans ago | 0

Answered

What do I have to do to sort strings properly in Listbox?

Don't ask the same question just because nobody answered it yesterday. If you are impatient, write a comment on it to bump it b...

What do I have to do to sort strings properly in Listbox?

Don't ask the same question just because nobody answered it yesterday. If you are impatient, write a comment on it to bump it b...

plus de 7 ans ago | 0

| accepted

Answered

how to convert Julian date to Gregorian date ?

Use |datestr|

how to convert Julian date to Gregorian date ?

Use |datestr|

plus de 7 ans ago | 0

| accepted

Answered

realtime data streaming between matlab and opencv, visual c++

How "realtime" do you need? If you were polling a file multiple times a second, would that be sufficient? Can you do your anal...

realtime data streaming between matlab and opencv, visual c++

How "realtime" do you need? If you were polling a file multiple times a second, would that be sufficient? Can you do your anal...

plus de 7 ans ago | 0

Answered

fprint error

Like the error message says, some of your inputs are structs, and that's not allowed. Run the following code to check the types...

fprint error

Like the error message says, some of your inputs are structs, and that's not allowed. Run the following code to check the types...

plus de 7 ans ago | 0

Answered

What is the purpose of this line in MATLAB's "factorial.m" function?

I would hazard that it is there to handle the special case of computing zero-factorial, which of course is 1.

What is the purpose of this line in MATLAB's "factorial.m" function?

I would hazard that it is there to handle the special case of computing zero-factorial, which of course is 1.

plus de 7 ans ago | 0

Answered

importing csv array of unknown size, characters

So the general thing is this... Keep track of the current state outside the loop: line_num = 0; % Current CSV line number...

importing csv array of unknown size, characters

So the general thing is this... Keep track of the current state outside the loop: line_num = 0; % Current CSV line number...

plus de 7 ans ago | 0

Answered

Non-numeric matrix to string

It's not a matrix. It's a cell array. You can try converting the whole thing to strings with something like: [M{:}] ...

Non-numeric matrix to string

It's not a matrix. It's a cell array. You can try converting the whole thing to strings with something like: [M{:}] ...

plus de 7 ans ago | 0

| accepted

Answered

Computer Vision - Feature Detection and Tracking - Tracking a RC car in a video

Of course, but you might have to implement a bunch of complex algorithms yourself. If you're not familiar with vision processin...

Computer Vision - Feature Detection and Tracking - Tracking a RC car in a video

Of course, but you might have to implement a bunch of complex algorithms yourself. If you're not familiar with vision processin...

plus de 7 ans ago | 0

Answered

Find Min& Max Togather

Well, I do it like this: function [Amin, Amax] = minmax( A ) Amin = min(A); Amax = max(A); end Note: Not to...

Find Min& Max Togather

Well, I do it like this: function [Amin, Amax] = minmax( A ) Amin = min(A); Amax = max(A); end Note: Not to...

plus de 7 ans ago | 0

Answered

Slightly off topic: determining at the Windows system level when my process is done

Why don't you invoke the shutdown as the last thing your MatLab script does?

Slightly off topic: determining at the Windows system level when my process is done

Why don't you invoke the shutdown as the last thing your MatLab script does?

plus de 7 ans ago | 1

Answered

Matrix to Table format

Are you saying you want to generate the SQL: CREATE TABLE my_table blah blah blah Followed by INSERT INTO my_table ...

Matrix to Table format

Are you saying you want to generate the SQL: CREATE TABLE my_table blah blah blah Followed by INSERT INTO my_table ...

plus de 7 ans ago | 0

Answered

Combine Two Different Images With Different Gain Values

Here's what I'd do... Convert all your images to 16-bit. Then take the factor-1 image, multiply it by 10. Then take the fac...

Combine Two Different Images With Different Gain Values

Here's what I'd do... Convert all your images to 16-bit. Then take the factor-1 image, multiply it by 10. Then take the fac...

plus de 7 ans ago | 1

| accepted

Answered

Temporal processing of image stack

Well, I'm not known for my solutions that take advantage of inbuilt MatLab functions... Maybe something like |filter| would be ...

Temporal processing of image stack

Well, I'm not known for my solutions that take advantage of inbuilt MatLab functions... Maybe something like |filter| would be ...

plus de 7 ans ago | 0

Answered

Financial contract value

Just a snippet of coding advice from me... If you need to use a number more than once, especially if it relates to how many v...

Financial contract value

Just a snippet of coding advice from me... If you need to use a number more than once, especially if it relates to how many v...

plus de 7 ans ago | 0

Answered

Entering data into MATLAB from a csv file containing both data and letters

textscan(currentLine, '%s%s%c%d%d%d%d%f%f')

Entering data into MATLAB from a csv file containing both data and letters

textscan(currentLine, '%s%s%c%d%d%d%d%f%f')

plus de 7 ans ago | 0

Answered

Deleting X-Y points that are not near other points on a field of data points

Naive (brute force) implementation given by per isakson looks sufficient for this problem. O(N^2) is okay for 900 rows. For la...

Deleting X-Y points that are not near other points on a field of data points

Naive (brute force) implementation given by per isakson looks sufficient for this problem. O(N^2) is okay for 900 rows. For la...

plus de 7 ans ago | 0