A résolu


Add two numbers
Given a and b, return the sum a+b in c.

presque 10 ans il y a

A résolu


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

presque 10 ans il y a

Réponse apportée
how to count number of repeating's in data series.
This code A = [22 24 24 36 36 36 48 48 48 48 24 33 22 22]'; C = accumarray(A,1); I = unique(A); counts = [I,C(I)] ...

presque 10 ans il y a | 3

Réponse apportée
how can i plot probability density distribution of f(x)=20000/(x+100)^3, x>0 ? thanks for the help
Like this: x = linspace(0,1000); fx=20000./(x+100).^3; plot(x,fx);

presque 10 ans il y a | 3

| A accepté

A résolu


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

presque 10 ans il y a

A résolu


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

presque 10 ans il y a

A résolu


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

presque 10 ans il y a

A résolu


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

presque 10 ans il y a

Réponse apportée
Copy certain number from one matrix to another
This version only requires one instance of ARRAYFUN A = [1:12;2,1,1,2,2,2,1,1,2,2,2,1]'; I = (A(:,2)==2); J = dif...

presque 10 ans il y a | 4

Réponse apportée
How do I create a histogram plot, y axis = number of objects, x = spot intensity and analyse it using a mixed gaussian distribution. I know that the data presented does not have much skew but I am just learing MATLAB
Use histogram function in Matlab <https://it.mathworks.com/help/matlab/ref/histogram.html>

presque 10 ans il y a | 3

| A accepté

Réponse apportée
How to calculate the errors of histogram?
Just sum the errors that belong to the specific bins: assume in bin1 are counted data x2,x6,x7,x9, then error_bin1 = e2+e6...

presque 10 ans il y a | 3

| A accepté

Réponse apportée
I have a 3D shape, defined with a triangular mesh model (2 matrixes: one of points; 1 of indexes of points defining triangles). I have some points of interest on this 3d shape. How can I calculate tangent planes to the surface for these points?
You need to find the tangent plane that contains all your points of interest? Are they co-planar or not? How many tnagent planes...

presque 10 ans il y a | 3

Réponse apportée
Solving complex nonpolynomial equation and find all complex roots
To find all solutions you need global solvers, but they don't exist.. One thing that you can do is trying to initialize *fsolve*...

presque 10 ans il y a | 3

Réponse apportée
What method does Matlab use to compute an approximation of an integral which contain singularities?
<https://www.mathworks.com/moler/quad.pdf>

presque 10 ans il y a | 3

| A accepté

Réponse apportée
How to stop a matlab process, if it exceeds certain time threshold?
<https://it.mathworks.com/help/matlab/ref/tic.html> <https://it.mathworks.com/help/matlab/ref/toc.html>

presque 10 ans il y a | 3

Réponse apportée
How to add all values greater than specific value in coloumn vector ?
If A is your vector, simply do s = sum(A(A>1));

presque 10 ans il y a | 4

| A accepté

Réponse apportée
write image and display
Do this. H=zeros(100); H(:,10:20)=1; H(:,80:90)=1; H(46:55,10:90)=1; imagesc(H); axis image; It should be th...

presque 10 ans il y a | 3

| A accepté

Réponse apportée
Finding patterns in my array
Assume A is you matrix with values from 1 to 5. You can map automatically the entries having the same value in this way: C ...

presque 10 ans il y a | 3

| A accepté

Réponse apportée
Splitting up a matrix - how can I do it more efficient?
This will do your work efficiently. %matrix size n = 200; m = 8; %number of rows to cut t = 20; %generate ma...

presque 10 ans il y a | 5

| A accepté

Réponse apportée
slash / after text .txt
Just print it before closing the file. % open your file for writing fid = fopen('test.txt','wt'); fprintf(fid,...

presque 10 ans il y a | 4

| A accepté

Réponse apportée
How to interpolate a function out of an array of measured points
This signal is very regular. You can decompose it by sine of cosine series, and just keep the dominant terms. An alternative is ...

presque 10 ans il y a | 3

| A accepté

Réponse apportée
I have to get the x values for peaks occuring in my plot? What will be the code for that?
There is Matlab function *findpeaks* <https://it.mathworks.com/help/signal/ref/findpeaks.html>

presque 10 ans il y a | 3

| A accepté

Réponse apportée
Array values not corresponding to condition
Your problems only arise because you used only "<" operators, so the numbers that are exactly in the middle of your intervals do...

presque 10 ans il y a | 3

| A accepté

Réponse apportée
Get the input text bold
Open MATLAB, select the HOME tab, click on PREFERENCES. On the left of the window appearing, click on FONTS and select what you...

presque 10 ans il y a | 1

Réponse apportée
Text cutting in the colorbar.
To export nice figures in Matalb, use this: <https://it.mathworks.com/matlabcentral/fileexchange/23629-export-fig>

presque 10 ans il y a | 3

| A accepté

Réponse apportée
Populating a matrix with variables
Best way to populate diagonal matrix is to use *spdiags* (see help page). For example, to obtain A=[1,2,0,0,0,0; ...

presque 10 ans il y a | 3

Réponse apportée
Error using ./ Matrix dimensions must agree.
To achieve what you want, you have to generate all possible copules of values from x and r (no matter their sizes). Given your v...

presque 10 ans il y a | 3

Réponse apportée
How to rotate a rectangle until one of the edges is parallel to the x-axis (with unknown rotation angle)?
To find the angle between the edge of the rectangle and the x-axis do simply (using your notation for vertex as x,y): c=[x(...

presque 10 ans il y a | 4

| A accepté

Réponse apportée
hist3 not returning expected output (weird range for indices etc)
The behaviour of hist3 is correct. Think about this: in the first dimension (say "x") you only have one coordinate number that r...

presque 10 ans il y a | 4

| A accepté

Réponse apportée
What is the matrix operation mnrval does with its inputs?
The reference in the Matlab help page for *mnrval* <https://it.mathworks.com/help/stats/mnrval.html> is McCullagh, P.,...

presque 10 ans il y a | 3

| A accepté

Charger plus