Réponse apportée
How to find out single object in binary image?. & how to calculate area of that single object?
Use _regionprops_ : cc = your binary image; my_area = regionprops(cc, 'Area'); % this will return the areas of the o...

plus de 12 ans il y a | 0

Réponse apportée
Why are the values I write into a file are not the same as what I read from it?
Use _fprintf_ and _fscanf_ : x = 0:.1:1; A = [x; exp(x)]; % write to file fileID = fopen('exp.txt','w'); fprint...

plus de 12 ans il y a | 1

| A accepté

Réponse apportée
use of vairibles with solve
The following code should not give you any trouble: syms x b = 3; % use your own value here my_answer = solve (cos(...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
extracting data points after fitting
Save the fitting in the workspace, then: my_pol = [fitting.p1 fitting.p2]; % insert the parameters from your fitting X =...

plus de 12 ans il y a | 0

Réponse apportée
Fusing edges of the images..
I = imread('circuit.tif'); BW1 = edge(I,'prewitt'); BW3 = uint8(BW1*255); imshow(BW1) figure,imshow(I) figure,i...

plus de 12 ans il y a | 1

| A accepté

Réponse apportée
waterfall plot with station no., depth, temperature data
For a basic representation, and if your arrays are of the same length, just use plot3 For a more sophisticated data repr...

plus de 12 ans il y a | 0

Réponse apportée
Read the Text File in matlab
What's the contents of the original file? The output will depend on the coding of the original file. Were all the characters in...

plus de 12 ans il y a | 0

Réponse apportée
matlab won't show text while cennecting to a database
Add a very short pause right AFTER the set line: ... ... set(handles.text10,'String',[message,' Connection check in p...

plus de 12 ans il y a | 0

Réponse apportée
Find multiple solutions to one equation by changing value of variables
u = -10:0.1:10; % values range from -10 to 10 in 0.1 steps. Set your boundaries v = -10:0.1:10; % values range from -10...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
Can you open a file that is not in your matlab directory with the fopen function?
yo just have to specify the full path: fid=fopen('C:\users\your_name\Desktop\your_file.txt');

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
How can I change variables in for loop in order to use the variables in subs?
Look at the code below and see the differences with yours. The one below returns what you want. syms x y a thr; eq1='x^2...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
How can I calculate the error rate?
error_rate = mean(A-B)

plus de 12 ans il y a | 0

Réponse apportée
How do I put these 'if' statements in the same loop?
You can write C like this: C=[AB(1,1)==AB(1,2); AB(2,1)==AB(2,2)] to achieve the same.

plus de 12 ans il y a | 0

Réponse apportée
Generating a single pulse in time?
Your tspan is tspan=[0,1000]; it should be: tspan=0:1000; You will get this plot: <</matlabcentral/answers/...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
Generating a single pulse in time?
It is easier to do: t = 0:1000; s = zeros(length(t)); s(t>400 & t<500) = 2; plot(t,s) <</matlabcentral/an...

plus de 12 ans il y a | 0

Réponse apportée
how to write binary image into text file
M = your_matrix_with_image_data; fid = fopen('your_binary_im.txt', 'w+'); for i=1:size(M, 1) fprintf(fid, '%f ', ...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
Problems with deploying stand alone application (x64)
Did you take a look at this? http://www.mathworks.es/videos/deploying-applications-with-matlab-68742.html Make sure you fo...

plus de 12 ans il y a | 0

Réponse apportée
how to generate random variables with gaussian distribution with 0 mean and 1 standard deviation.
r = rand(n) returns an n-by-n matrix containing pseudorandom values drawn from the standard uniform distribution on the open int...

plus de 12 ans il y a | 1

Réponse apportée
HOW TO FIND THE VELOCITY OF AN IMAGE?
You can not calculate the speed of an object within an image unless you know the length of the objects and the time taken by the...

plus de 12 ans il y a | 0

Réponse apportée
how to create background subtration in one image
You can take an image of what you call the background without the objects you will want to extract in the future. Once you intro...

plus de 12 ans il y a | 0

Réponse apportée
How can I add the average of two consecutive numbers?
n = length(y); Area = 0; for k=1:(n-1) Area = Area + (y(k) +y(k+1))/2; end

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
Determing if a point is inside an ellipsoid
the point (x,y,z) will be inside the ellipsoid when (x-xo)^2/a + (y-yo)^2/b +(z-zo)^2/c < 1 it will be outside the elli...

plus de 12 ans il y a | 1

| A accepté

Réponse apportée
??? Attempted to access cmtx(1.00024,1); index must be a positive integer or logical.
your sentece: cmtx(fix(rt(m,n))+1,fix(rt(m,n+1))+1) = cmtx(rt(m,n)+1,rt(m+1,n+1)+1) + 1 returns a value for rt(m...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
is this a matlab bug?
The pivot year is used in interpreting date strings that have the year specified as two characters. To see the difference, intro...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
Are admin privileges required for changing Matlab settings?
You do not have to have administrator privilege to change preferences in Matlab.

plus de 12 ans il y a | 0

Réponse apportée
Matlab (R2012b) on windows 7 closing itself while running scripts
It looks like you are running of of memory. Did you try to reduce the number of files you work with? Start by analysing just a f...

plus de 12 ans il y a | 0

Réponse apportée
Initializing a struct with n-d fields.
Initialization as NaN of three fields called field1, field2, field3: for k=1:3; data.(strcat('field',num2str(k))) =...

plus de 12 ans il y a | 0

Réponse apportée
Problem of generating 4 sub-images
I = your_image; [r c l] = size(I); % image dimensions r2 = floor(r/2); c2 = floor(c/2); I1 = imcrop(I,[1 r2 1 c2]...

plus de 12 ans il y a | 0

Réponse apportée
Explicit multiplication of matrices using for loops
for ix = 1:3; % loop along the elements of yex yex(ix)=0; % initialization of ix-th element of yex to zero ...

plus de 12 ans il y a | 0

Réponse apportée
fread doesn't work
You are trying to read data that are not available yet. Try with _fscanf_.

plus de 12 ans il y a | 0

Charger plus