Respondida
Unexpected pdist2 behavior?
In the DOC of PDIST2 it has been mentioned that the custom distance must able to accept second parameter of (m x 3) as m points ...

casi 8 años hace | 0

Respondida
Frequency Response Function and Delay
When you compute the phase there is always an arbitrary shift of (k*2*pi), k integer. I think a reasonable assumption is make...

casi 8 años hace | 0

Respondida
How to use if statement to compare strings
if isempty(genderInput) || (lower(genderInput(1)) ~= 'm' || lower(genderInput(1)) ~= 'f') genderInput = input('Please ...

casi 8 años hace | 0

Respondida
Unique values per row
>> A=[1 2 3; 4 4 5; 6 6 6] A = 1 2 3 4 4 5 6 6 6 >> sum(diff...

casi 8 años hace | 5

| aceptada

Respondida
Finding the index of a string within an array of strings
May be this is what you want? find(strcmp({'0' 'P' 'E' 'M'},'P'))

casi 8 años hace | 3

| aceptada

Respondida
Temperature variation against time
Your expectation is wrong (((QQ2(j)*A*3600))-(mw*lw)) are negative (from -1.4458e+07 to -1.1234e+7) Therefore as lon...

casi 8 años hace | 1

Respondida
How to find the indices of a matrix element that is inf or NaN?
Wrong diagnostic: h = find(~isfinite(V)) is right. You probably shadow something or V is not what you think of.

casi 8 años hace | 3

Respondida
when I run this code I get Undefined function or variable 'U'.
MATLAB makes distinction between upper case and lower case in variable name. If you call [u,d,v]=svd(K); then you have t...

casi 8 años hace | 1

Respondida
I have one curve. I want to create another curve offset to that one at right angle.
<</matlabcentral/answers/uploaded_files/139542/offset.png>> %initial conditions% t = 0:0.01:1; b0 = (1-t).^2; b1 =...

casi 8 años hace | 0

| aceptada

Respondida
Can someone please help me implementing this code without loop ?
f = rand(4,5); [m,n] = size(f); x = 2:m-1; y = 2:n-1; v1 = max(abs(f(x+1,y)-f(x,y)),abs(f(x-1,y)-f(x,y))); v2...

casi 8 años hace | 0

| aceptada

Respondida
Why Matrix dimensions do not agree?
Try this: load data1 P v; Vmax3 = 4; S2 = 40-P; Km3 = 3; k1 = 30; P0 = [Vmax3, Km3, k1]; ...

casi 8 años hace | 1

| aceptada

Respondida
Diagonal matrix from multiple columns of an array
Take a look at |spdiags|

casi 8 años hace | 0

| aceptada

Respondida
how to delete rows in cell array
>> A=rand(5,3) A = 0.3012 0.2259 0.9234 0.4709 0.1707 0.4302 0.2305 0.2277 0...

casi 8 años hace | 0

| aceptada

Respondida
Vector of floating-point numbers
Yfit = predict(B,X)

casi 8 años hace | 1

Respondida
How do i generate a random set of numbers of -1s and 1s without getting any 0s?
values = [-1 1]; x = values(randi([1 2],[1000,1]))

casi 8 años hace | 1

Respondida
How do i generate a random set of numbers of -1s and 1s without getting any 0s?
x = 2*(rand(1000,1)>0.5) - 1

casi 8 años hace | 0

Respondida
How to update an element of vector every cycle?
MATLAB is 1-based indexing, you light change the for-loop to start at 1 for i= 1:iter_max or shift the storage index by ...

casi 8 años hace | 0

| aceptada

Respondida
How to select only a few design points from a huge data space?
_'Problem is I can only identify the possibilities I am interested in by checking the value of each design point.'_ I'll save...

casi 8 años hace | 0

Respondida
solve 4 equations with some unknowns parameters.
Your problem looks like you find the EM field with 3 layers and 2 interfaces. The coefficients A, B, C, D gives the strength of ...

casi 8 años hace | 0

| aceptada

Respondida
How to use fminimax
I believe for FMINIMAX the inner-max (min for your case) is performed on discrete set of variables, which corresponds the length...

casi 8 años hace | 0

Respondida
prime number.there isn't any error. my ans isn't showed up
There is actually one error (where counter is reset) for j= 1:10 counter=0; % <- reset for every i to be checked ...

casi 8 años hace | 0

| aceptada

Respondida
How to find indices of a rectangular region inside big matrix? | Efficiently
recidx = (Row_start:Row_End)' + height*(Col_start-1:Col_end-1)

casi 8 años hace | 1

| aceptada

Respondida
Why fix(0.05/0.05) isn't working properly in coint counting algorithm ? If I enter let's say 3.76 it gives me the correct answer,but when I enter 3.75,it gives me 9 coins..
Welcome to the word of numerical precision. |Rest| and |FiveCent| look the same but they are not equal: What is the amount...

casi 8 años hace | 1

| aceptada

Respondida
multiplying all elements by fellow elements
Not clear what you want but KRON might be what you are looking for >> A=[1 2; 4 3] A = 1 2 4...

casi 8 años hace | 1

Respondida
How can I find a spline through points without exceeding known slope
Yet another <https://fr.mathworks.com/matlabcentral/fileexchange/25872-free-knot-spline-approximation FEX tool> that allows to c...

casi 8 años hace | 1

| aceptada

Respondida
Performance comparison among Struct Array, Cell Array and Table
My general rule of thumbs: * Simple Array is the fastest * Using cell if you don't have a choice (mixing class or uniform si...

casi 8 años hace | 3

Respondida
Trying to write conditional if loop for an interval
This is not TeX or LaTeX disp(‘Cell Counts are within 10% limit’); MATLAB string quote is like this: disp('Cell Cou...

casi 8 años hace | 0

Respondida
Adding a constraint in @confun constrained optimization
Mathmematically you could define another constraint function h(x) := sup { g(y): y in [0,x] } then optimize your objecti...

casi 8 años hace | 1

| aceptada

Respondida
Finding Shortest distance from a point to a Line,which passes through a midpoint and is oriented at an angle Theta to X-Axis
Assuming your points are (2 x 1) vectors d = abs(dot(Q-P,[-sin(theta);cos(theta)]))

casi 8 años hace | 0

| aceptada

Respondida
Can .p files expire?
Probably the author implemented expiration check in the pfile, nothing exists in such for standard pfile.

casi 8 años hace | 2

| aceptada

Cargar más