Réponse apportée
How to sum only the positive elements in a vector using an If-Statement?
You can do that without if let's say d is your array of positive and negative numbers. You want to sum only the positive ones...

presque 12 ans il y a | 7

| A accepté

Réponse apportée
How to calculate equation with multiple variables?
F=@(x,rho,phi,z) (A(x)*(x*Ym(beta(x)*rho)+beta2(x)*Jm(beta(x)*rho)*cos(m*phi)*exp(1i*beta3(x)*z)); you can define other...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
How to exclude min and max only once in a if statement?
What you did was correct. Just add an "end" at the end of your code and change if n>0 %% n<= 5 to if n>0 && n<= 5 ...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
If statment with multiple conditions
if any(answer==[1,2,3]) frequency=input('Enter a frequency: '); amplitude=input('Enter an amplitude: '); ccyc...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
Polyfit with centering and scaling values
because ppp fits y to x but ppp1 fits y to x^ where x^ = (x-mu1)./mu2; check this code: x = (0: 0.1: 2.5)'; y = er...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
How do I create a Projection Matrix for 3D Reconstruction Visual Hull Matlab code?
http://www.mathworks.com/help/vision/ug/single-camera-calibrator-app.html

presque 12 ans il y a | 0

| A accepté

Réponse apportée
Count number of rows without NaNs
sum(and(~isnan(Data{1,1}(:,2)),Data{1,1}(:,8)==1)) gives you the count of rows that don't have NaN on the second column and...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
Creating a matrix of sinusoids with frequency increasing over columns and time increasing over rows
minT=0; maxT=1; dT=0.01; minF=1; maxF=4; dF=1; [Time,frequency]=ndgrid( minT:dT:maxT , minF:dF:maxF ); ...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
Strange slope for points in a curve
There are two slopes at each point. The left slope and right slope? What you want to do about that?

presque 12 ans il y a | 0

| A accepté

Réponse apportée
Finding positions of a partial string in a cell array
Data={'/SH','abcd','abcd';'abcd','/SH','/SH'} Data = '/SH' 'abcd' 'abcd' 'abcd' '/SH' '/SH' ...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
Split a matrix into a two submatrixes by a condition
If this is MATLAB programming class tell your teacher that using "for" and "if" is not necessary the correct way of learning mat...

presque 12 ans il y a | 1

| A accepté

Réponse apportée
Storing multiple function outputs in an iterative loop
store them as cell arrays [X{i},Y{i},Z{i}] = myfunction(input_variable); x{1} could be NxM matrix X{2} could be RxCxT m...

presque 12 ans il y a | 4

| A accepté

Réponse apportée
How to use previous results of a non-linear function as the initial "guess" for the next step?
Instead of hard coding the initial guess take that in as an input P=[initial values] P=myNLfuction(someinput, P) % t...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
how we can amplify an image with nearest neighbour interpolation
Amplify?? you mean resize? if that's what you mean here is the code IResized= imresize(I,scale,'nearest');

presque 12 ans il y a | 0

| A accepté

Réponse apportée
Is there any way to do an operator on a specific region
Something like this would work. [r,c]=size(BWImage); rHalf=round(r/2); cHalf=round(c/2); lowerLeftQuadrant...

presque 12 ans il y a | 1

| A accepté

Réponse apportée
reading strings between spaces from a text file.
you could use fid = fopen('test_text.txt','r'); xdata=str2num(fgets(fid)) fclose(fid) or you can use M = dl...

presque 12 ans il y a | 3

| A accepté

Réponse apportée
Why using mldivide to solve high dimension linear equations would cause computational error
I am guessing the condition number of your matrix. The error in matrix inversion get's worse as the condition number of a mat...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
Optimal strategy for loading in many tiffs and resaving as imageJ tiff stacks
Ok, if you are just moving files from one folder to another you can do it at the command prompt, you don't really need matlab. B...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
How to inverse a matrix efficiently?
if you are not looking for symbolic solution to the matrix inversion, but you have the numerical values of the entries in ...

presque 12 ans il y a | 1

| A accepté

Réponse apportée
Replace jth zero in vector with j
zeroMask = (x==0); x(zeroMask) = 1:sum(zeroMask);

presque 12 ans il y a | 0

| A accepté

Réponse apportée
Using fprintf to open a .txt file of text (NOT data)
fid=fopen('test.txt','w'); str='Actual textual thing, Once upon a time there was a princess trapped in the tower.'; fpri...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
How to create a table for CSV-Output from an array and strings?
Let's say myArray is your NxN matrix and colNames is a cell array storing the labels, i.e. colNames={'Label1','Label2',...,'Labe...

presque 12 ans il y a | 1

| A accepté

Réponse apportée
boundary conditions for PDE
This has nothing to do with matlab. For your linear advection equation, you can use periodic boundary condition, neumann boun...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
Using post classification confusion matrix
Well, the answer is right in front of you. BW_1 has 2592x4608=11943936 elements while new_image{1} has 7776x4608=35831808 elem...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
how to save the content of the current figure as an image?
saveas(gcf,'filename.png') would also work. or something like this for i=1:30 % code to show image number i ...

presque 12 ans il y a | 7

| A accepté

Réponse apportée
The replacement is slow. is there a better way?
It seems *rrr(binZ)=NaN;* should also work for you. I am assuming binZ is a logical big matrix where the entry is true if that e...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
Hey! I am new to matlab and I need some help here.
% Let's say: a=3; b=2; c=1; % we have y= ax^2 + bx + c; % so the function to plot would be y=3x^2+2x+1; ...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
Create matrix using nested loops
Theta=[0, 90, 180, 270, 360]; Y=zeros(2,numel(Theta)) Y(1,:)=sind(Theta); Y(2,:)=cosd(Theta); NOTE the "d" aft...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
delete zero rows only with one number
This will work *A(~any(A'==0),:)* Don't forget " ' " to transpose A in ~any(A *'* ==0). Alternatively if you want to ...

presque 12 ans il y a | 1

| A accepté

Réponse apportée
How to import multiple txt files in different folders into workspace at one time?
have you tried "textread" command? It has a headerline parameter that tells how many line to ignore. You need to call that funct...

presque 12 ans il y a | 0

| A accepté

Charger plus