Answered
Plot plane using a line and a point?
x1=86;y1=115;z1=11420; x2=167;y2=70;z2=9240; x3=167;y3=115;z3=9240; p=null([x1,y1,z1,1; ... x2,y2,z2,1; ... ...

4 years ago | 0

| accepted

Answered
Is the 8th term maximum in the curve fitting toolbox and command line?
Perhaps just do an FFT decomposition and select the 10 strongest frequencies.

4 years ago | 0

Answered
Is the 8th term maximum in the curve fitting toolbox and command line?
You will probably have to use a custom model, or else resort to lsqcurvefit().

4 years ago | 0

Answered
How to limit variables in input function?
It does not make sense to have a tilde as an input argument in a function call. Perhaps you meant, tcfun3(1,P_min11 (j), T, 1)...

4 years ago | 0

| accepted

Answered
I want to compare each element in 2 matrix same size and display a text in every case.
A=[1 2 3 4 5]; B=[2 4 9 8 2 ]; t=["no", "yes"]; t((A<B)+1)

4 years ago | 0

| accepted

Answered
Are recursively defined or nested anonymous functions dangerous?
I don't know about dangerous, but it is definitely inefficient and harder to debug. It will run much faster if you just implemen...

4 years ago | 0

| accepted

Question


Save LiveScript as an MS Word document, but keep the equations editable
When I save a Live Script as a Word .docx file the equations are all converted to images, and therefore are not editable. Is th...

4 years ago | 1 answer | 1

1

answer

Answered
String array to matrix
Here's an example with comma separators instead of tabs, but it would work the same way. a=["1,2";"3,4"] c=arrayfun(@(z)st...

4 years ago | 0

| accepted

Answered
Converting a system of coordinates
You need to measure the position of at least three non-colinear 3D points in both coordinate systems. Then, you can find the map...

4 years ago | 0

Answered
Extract sub array from d-dimensional array given indices for each dimension
If you have your vd_i in a cell array V={vd_1,vd_2,...,vd_d}, you can do A(V{:})

4 years ago | 0

| accepted

Answered
How to count numbers greater than a determined value
out = cumsum( histcounts(heights,0.5:0.1:100-eps(100)) ,'reverse');

4 years ago | 0

| accepted

Answered
Take data out of a structure horizontally
Transpose the matrices.

4 years ago | 0

Answered
Change initial step length in fmincon
You have some control over the step distance used for finite differencing operations (through FiniteDifferenceStepSize), and for...

4 years ago | 0

Answered
Meshgrid orthogonal to a line in 3D Space
You can also start with an unrotated grid, then rotate it: d=[1;1;1]; d=d(:).'/norm(d); [X,Y,Z]=meshgrid(-5:5); R=[d;null...

4 years ago | 0

Answered
Meshgrid orthogonal to a line in 3D Space
There are also ready-made File Exchange tools you can use, like this one d=[1;1;1]; %direction of line d=d(:)./norm(d); gtP...

4 years ago | 0

Answered
Meshgrid orthogonal to a line in 3D Space
Pick a 3D direction vector for the straight line, e.g. d=[1,1,1]; Then, d=d(:)./norm(d); B=null(d.'); %basis [x...

4 years ago | 0

Answered
how can i plot a continuous unit step function without heaviside?
Hint: t=linspace(-1,3,100); u=(t>1); plot(t,u); axis padded; xlabel t; ylabel u

4 years ago | 0

| accepted

Answered
Calculate mean value of every element of a .mat file
S = structfun( @mean, load('yourFile.mat'),'uni',0); matrix=cell2mat(struct2cell(S));

4 years ago | 0

| accepted

Answered
program that performs 3D geometric transformations
imwarp will probably do most of the heavy-lifting for you. It's not clear to me what is meant by "More than one transformation s...

4 years ago | 0

Answered
How to avoid hessian being 0 in fminunc(maximum likelihood estimation)?
Operations in the objective function like this, min(.999999,normcdf(e_inside(t,i)) are technically illegal, since min(a,b) is ...

4 years ago | 0

Question


Automatic numbering and cross-referencing of sections in Live Script
I am investigating the possibility of having automatic section numbering and cross-references in Live Script. Here is an example...

4 years ago | 1 answer | 0

1

answer

Answered
Combining two matrices with different sizes
M3=zeros(600,2,7); M3(230:598,:,:)=M2; M3(250:2:600,:,:)=M1; %replace M2 with M1 M3(1:2:end,:,:)=0;%odd numbers are zer...

4 years ago | 1

| accepted

Answered
Divide each column by the sum of the column in a matrix
D./sum(D)

4 years ago | 1

| accepted

Answered
How can i run this code? I get erros "Unable to perform assignment because the size of the left side is 1-by-600 and the size of the right side is 1-by-100."
for j=1:numel(H) for i= 1:numel(T) Tx = T(i); Hx = H(j); P(i,:,j) = fvdWEOSp(Tx,V,Hx); end ...

4 years ago | 0

Answered
multi array vectorization problem (reformulated)
runtest(1e2) function runtest(N) A = [ -0.8013 -0.4981; -0.2278 -0.9009]; t = 0:0.01:N; b = [2;3]; [V,d]=eig(A,'v...

4 years ago | 1

| accepted

Answered
Change the location of points in a 2D meshgrid
location=location+rand(size(location))*0.3+0.2;

4 years ago | 0

| accepted

Answered
How to formulate the following matrices?
T=makehgtform('translate',[x(i),y(i),0],'zrotate',theta(i)); T=T([1,2,4],[1,2,4])

4 years ago | 1

| accepted

Answered
bwlabeln 3D connections not a subset of its 2D connections
My guess is that the 4-connected regions are indeed subsets of the 26-connected regions, as you expect. However, in the 26-conne...

4 years ago | 1

| accepted

Answered
Imposing Constraint in FMINCON optimization problem.
x0 = zeros(1,N_plies); lb = [-ones(1,N_plies)*90 zeros(1,N_plies)]; ub = [ones(1,N_plies)*90 ones(1,N_plies)*t]; Aeq=zeros...

4 years ago | 1

| accepted

Answered
How to Multiply the following matrices case?
T=rand(3,3,18); D=rand(3,1,18); M=pagemtimes(T,D(:,:)); M(:,logical(eye(18)))=[]; M=reshape(M,3,17,18); whos M

4 years ago | 0

| accepted

Load more