Risposto

Efficiently populating an array without for loops

Yeah that's searching through your data an awful lot every time you do the |==| comparisons. The way I do this kind of thing wh...

Efficiently populating an array without for loops

Yeah that's searching through your data an awful lot every time you do the |==| comparisons. The way I do this kind of thing wh...

oltre 11 anni fa | 0

Risposto

how to label the vacant space

I wouldn't use regionprops here. That just connects pixels. You can't guarantee that will have anything to do with empty parkin...

how to label the vacant space

I wouldn't use regionprops here. That just connects pixels. You can't guarantee that will have anything to do with empty parkin...

oltre 11 anni fa | 0

| accettato

Risposto

Compare two strings based on ASCII dictionary order

Yeah this is a real failing of the |strcmp| function in my opinion. That function originated in C, and would tell you whether a...

Compare two strings based on ASCII dictionary order

Yeah this is a real failing of the |strcmp| function in my opinion. That function originated in C, and would tell you whether a...

oltre 11 anni fa | 3

Risolto

Find the longest sequence of 1's in a binary sequence.

Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

oltre 11 anni fa

Risolto

Too mean-spirited

Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

oltre 11 anni fa

Risposto

two picture pixels

You are addressing |fd(:,:,:,a)| as a 4-dimensional array, but it is declared as a 1-dimensional array. You need to make sure...

two picture pixels

You are addressing |fd(:,:,:,a)| as a 4-dimensional array, but it is declared as a 1-dimensional array. You need to make sure...

oltre 11 anni fa | 0

Risposto

Reading Binary(?) to hex to float.

Um, you're reading one at a time? Can you not first determine the file size: fseek(fid, 0, 'eof'); fsize = ftell(fid)...

Reading Binary(?) to hex to float.

Um, you're reading one at a time? Can you not first determine the file size: fseek(fid, 0, 'eof'); fsize = ftell(fid)...

oltre 11 anni fa | 1

Risposto

Estimation of the "pixelization" error introduced when using the digital image processing toolbox

This is just a stab in the dark, but I gather that after processing you get an image with logical (0 or 1) pixels, and you obta...

Estimation of the "pixelization" error introduced when using the digital image processing toolbox

This is just a stab in the dark, but I gather that after processing you get an image with logical (0 or 1) pixels, and you obta...

oltre 11 anni fa | 0

Risposto

search algorithm in the volume of a cone.

Well, you need a point that defines the apex of the cone, a vector definining the cone's major axis, and the half-angle (angle b...

search algorithm in the volume of a cone.

Well, you need a point that defines the apex of the cone, a vector definining the cone's major axis, and the half-angle (angle b...

oltre 11 anni fa | 0

| accettato

Risposto

How to stack image files if they are of different size

When you say 'stack', are you storing each image as a 'page' in some dimension? So you might have: imageStack = nan( maxHe...

How to stack image files if they are of different size

When you say 'stack', are you storing each image as a 'page' in some dimension? So you might have: imageStack = nan( maxHe...

oltre 11 anni fa | 0

| accettato

Risposto

Creating .txt file with matlab

This opens the file once (overwriting if it already exists) and writes your results one line at a time. fid = fopen( 'resul...

Creating .txt file with matlab

This opens the file once (overwriting if it already exists) and writes your results one line at a time. fid = fopen( 'resul...

oltre 11 anni fa | 4

| accettato

Risposto

How to read any file by using txt ?

The only difference between reading a binary file versus a text file is to translate end-of-line characters. Other than that (a...

How to read any file by using txt ?

The only difference between reading a binary file versus a text file is to translate end-of-line characters. Other than that (a...

oltre 11 anni fa | 0

Risposto

how to read complicated CSV files into matlab?

Easiest is to read your file one line at a time, and separate your sections. If your files follow exactly the format you've lis...

how to read complicated CSV files into matlab?

Easiest is to read your file one line at a time, and separate your sections. If your files follow exactly the format you've lis...

oltre 11 anni fa | 0

| accettato

Risposto

custom byte swapping of binary file

Hey Peter, do you actually know the format of your data? I was under the impression that you didn't know what the binary struct...

custom byte swapping of binary file

Hey Peter, do you actually know the format of your data? I was under the impression that you didn't know what the binary struct...

oltre 11 anni fa | 2

Risposto

grouping observations with specific characteristics

You mean you want to sort by Location, then Time, then Country, then Price? Before you go MatLabbing this... Would you consi...

grouping observations with specific characteristics

You mean you want to sort by Location, then Time, then Country, then Price? Before you go MatLabbing this... Would you consi...

oltre 11 anni fa | 0

| accettato

Risposto

Select data by attributes

Do you mean you have a structure: Polylines.Accuracy Polylines.SomeOtherField1 Polylines.SomeOtherField2 ... etc ...

Select data by attributes

Do you mean you have a structure: Polylines.Accuracy Polylines.SomeOtherField1 Polylines.SomeOtherField2 ... etc ...

oltre 11 anni fa | 1

| accettato

Risposto

Connected component labeling

Is this an assignment for a course you are doing? If so, what algorithms have you discussed in lectures? Surely you would not ...

Connected component labeling

Is this an assignment for a course you are doing? If so, what algorithms have you discussed in lectures? Surely you would not ...

oltre 11 anni fa | 1

Risposto

image color detection

What about purplish-greenish-gray? Where do you draw your boundary? Anyway... A simple approach here is to define all t...

image color detection

What about purplish-greenish-gray? Where do you draw your boundary? Anyway... A simple approach here is to define all t...

oltre 11 anni fa | 1

Risposto

How to create a regular data matrix from irregularly sampled XYZ data with different X and Y coordinates

Well, I might do this: d = [2.0000 0 0.3800; 2.0000 5.0000 0.3480; 2.0000 25.0000 0.3...

How to create a regular data matrix from irregularly sampled XYZ data with different X and Y coordinates

Well, I might do this: d = [2.0000 0 0.3800; 2.0000 5.0000 0.3480; 2.0000 25.0000 0.3...

oltre 11 anni fa | 0

| accettato

Risposto

Find Angle Between Two Line

When I want to find the angle between two vectors, I take the dot product of the unit vectors: clamp = @(val, low, high) mi...

Find Angle Between Two Line

When I want to find the angle between two vectors, I take the dot product of the unit vectors: clamp = @(val, low, high) mi...

oltre 11 anni fa | 0

Risposto

Help Sorting columns

Get the indices for sorting the last row: [~, I] = sort( data(end,:) ); And then reindex your matrix: sdata = data(...

Help Sorting columns

Get the indices for sorting the last row: [~, I] = sort( data(end,:) ); And then reindex your matrix: sdata = data(...

oltre 11 anni fa | 1

| accettato

Risposto

Index for loop

To do this in a loop (not the |find| command), you are doing a few things wrong. Here is your code: i=1; for item...

Index for loop

To do this in a loop (not the |find| command), you are doing a few things wrong. Here is your code: i=1; for item...

oltre 11 anni fa | 0

Risposto

I need one by the element-free Galerkin method for solving one-dimensional Burgers equation Matlab procedures, thanks a lot

There is some code here which is just waiting for a little more clarification from its author before the MatLab community can he...

I need one by the element-free Galerkin method for solving one-dimensional Burgers equation Matlab procedures, thanks a lot

There is some code here which is just waiting for a little more clarification from its author before the MatLab community can he...

oltre 11 anni fa | 0

Risposto

non linear data fit (weighted least square)

Let's say you have your function: f = @(x,a,b) = a * x.^b; Now, you have your data set and weights: X = [...]; Y...

non linear data fit (weighted least square)

Let's say you have your function: f = @(x,a,b) = a * x.^b; Now, you have your data set and weights: X = [...]; Y...

oltre 11 anni fa | 1

Risposto

rolling dice problem in cody..........error in this code??

Don't use round: |randi| already returns integers.

rolling dice problem in cody..........error in this code??

Don't use round: |randi| already returns integers.

oltre 11 anni fa | 0

| accettato

Risolto

Roll the Dice!

*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

oltre 11 anni fa

Risposto

subscript indices must either be real positive integers or logicals - how to change lat/lons from double to integers?

If they just need to be indices, you can use |ceil|, |floor|, |fix| or |round|. _eg_ x = fix(x) If you want to convert ...

subscript indices must either be real positive integers or logicals - how to change lat/lons from double to integers?

If they just need to be indices, you can use |ceil|, |floor|, |fix| or |round|. _eg_ x = fix(x) If you want to convert ...

oltre 11 anni fa | 0

| accettato

Risposto

vector sum and magnitude

Maybe this will help: function [vec, mag] = DoMyHomeworkForMe( v1, v2 ) % Your calculation goes here end

vector sum and magnitude

Maybe this will help: function [vec, mag] = DoMyHomeworkForMe( v1, v2 ) % Your calculation goes here end

oltre 11 anni fa | 1

Risposto

generating executable file

You must install the MCR on that system. Search your matlab installation tree for |MCRInstaller.exe| On my system it is in...

generating executable file

You must install the MCR on that system. Search your matlab installation tree for |MCRInstaller.exe| On my system it is in...

oltre 11 anni fa | 0

Risposto

What value have a variable 'edit text' guide

No, you need to use |isempty|. if isempty(T) T = 0.001; end Note that if you use |str2double| instead, you'll ge...

What value have a variable 'edit text' guide

No, you need to use |isempty|. if isempty(T) T = 0.001; end Note that if you use |str2double| instead, you'll ge...

oltre 11 anni fa | 1

| accettato