Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Respondida
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)] ...

más de 9 años hace | 3

Respondida
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);

más de 9 años hace | 3

| aceptada

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

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

más de 9 años hace | 4

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

más de 9 años hace | 3

| aceptada

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

más de 9 años hace | 3

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

más de 9 años hace | 3

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

más de 9 años hace | 3

| aceptada

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

más de 9 años hace | 3

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

más de 9 años hace | 4

| aceptada

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

más de 9 años hace | 3

| aceptada

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

más de 9 años hace | 3

| aceptada

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

más de 9 años hace | 5

| aceptada

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

más de 9 años hace | 4

| aceptada

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

más de 9 años hace | 3

| aceptada

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

más de 9 años hace | 3

| aceptada

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

más de 9 años hace | 3

| aceptada

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

más de 9 años hace | 1

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

más de 9 años hace | 3

| aceptada

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

más de 9 años hace | 3

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

más de 9 años hace | 3

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

más de 9 años hace | 4

| aceptada

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

más de 9 años hace | 4

| aceptada

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

más de 9 años hace | 3

| aceptada

Cargar más