Answered
Converting parallel CPU processing into GPU processing
I would like to process matrices in a cell array on the GPU in parallel for how many cores are present on the gpu. No, GPU core...

4 years ago | 0

Answered
Diagonal cross section of function z(x,y) for x=y
fcn=@(t) arrayfun(@(x) z(x,x), t); fplot(fcn)

4 years ago | 0

Answered
Select less value from matrix than proviusly selected
{A,B]=deal(zmiana); while ~isempty(A) & ~isempty(B) % V1 is the first value V1=A(randi(numel(A))); A(A>=V1)=...

4 years ago | 0

Question


Is there a way to obtain handles to the last N figures that were opened?
Sometimes, I have M figure windows open and I want to access only the last N<M of them. Is there any way to assess how recently ...

4 years ago | 1 answer | 0

1

answer

Answered
How to acces the value of a Optional-Positional argument (~ argument) ?
The ~ doesn't mean the input is optional. It means the function doesn't care what it is. Since your function does care, use a n...

4 years ago | 0

| accepted

Answered
Evaluate the intersection area between the circles and the rectangle with increasing number of circles(N) with increasing number of random distribution samples(qty)?
Currently, with N>1 you have more centers than you do radii. Also, you have not organized the data as a cell array.The area cal...

4 years ago | 0

Answered
Adding specific elements in a vector
e=1:max(a(:,1))+1; e([2,22:24,26:38])=[]; G=discretize(a(:,1),e); result=accumarray(G,a(:,2))

4 years ago | 0

| accepted

Answered
fmincon pause after 2 iterations when using gradients
I get my gradients from a different script by taking the symbolic jacobian of ceq, and using matlabFunction to generate a sparse...

4 years ago | 0

Answered
How do I find the indices of nonzero elements for a matrix of logical vectors?
A=[1 0 0 0; 0 0 1 0; 0 0 0 1]; [~,w]=max(A,[],2)

4 years ago | 0

| accepted

Answered
Labels on plot lines
Using the text() command? clear t Vkts = [120,110,100,90,80,70,60,50]; Vms = Vkts/1.944; Hdata=0:0.15:0.6; figure(1) ...

4 years ago | 0

| accepted

Answered
How to display a polygon and its centroid
close all, imshow(I), for k = 1:3 title(['Polygon # ' int2str(k)]); h = drawpolygon; wait(h); ...

4 years ago | 0

| accepted

Answered
How to evaluate the union area of the multiple circles plotted in matrix form of centers and radii?
An approximate calculation can be made as follows, C={centreG1,centreG2,centreG3,centreG4,centreG5,centreG6}; p=cellfun(@pol...

4 years ago | 2

| accepted

Answered
How to solve :'Error using prod. Invalid data type. First argument must be numeric or logical.'
We've no way of running your code, but I'm pretty certain if you just examine, K>> class(children(Term(ll))) all will be clea...

4 years ago | 0

Answered
How to perform 2 dimensional circular convolution
Using FFTs out = ifft2(fft2(A).*fft2(B));

4 years ago | 0

Answered
How to perform 2 dimensional circular convolution
function z=cyconv(x,y) %Non-Fourier domain cyclic convolution. % % z=cyconv(x,y) % %Note: y can be shorter in any of its d...

4 years ago | 0

| accepted

Answered
How to find IDTFT of an array in matlab?
Does matlab has any function for IDTFT It doesn't because your frequency domain data is not really continuous, you're really l...

4 years ago | 0

Question


vecnorm seems slower than it should be
In the speed comparison below, I would expect vecnorm() to be faster than the first version, because the first version creates a...

4 years ago | 1 answer | 2

1

answer

Answered
can you explain to me the error and fix it ? thanks
f= @(x) 1 + 5.25*x - sec(sqrt(0.68*x)); fplot(f,[0 5])

4 years ago | 0

| accepted

Answered
how can i get a column by it's variable name
Masse_ =Masse.(A(2))

4 years ago | 0

| accepted

Answered
cutting a smaller potion of an image
If you download https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-into-equal-sized-sub-arrays ...

4 years ago | 0

Answered
How to calculate absolute mean across numerical array
mean_array = vecnorm(P_acc_y, 1, 2)/24;

4 years ago | 1

Answered
How to calculate absolute mean across numerical array
mean_array = mean( abs(P_acc_y), 2);

4 years ago | 0

| accepted

Answered
Help with graph plotting
Your a and b contain data for 2 lines.

4 years ago | 1

| accepted

Answered
How to write syntax for ga(GA) when we put constraints on the objective function?
In your nonlcon function function [c,ceq]=nonlcon(x) ceq=[]; c=f(x)-6; end

4 years ago | 0

Answered
Does regionprops function work in Matlab App designer
The reason is that your bw is all zeros. Nothing to do with app designer.

4 years ago | 0

Answered
How can i fix this error?
You have a loop running from 2 to 101 for i=2:101 Vr1=Vr1+pi*(1/5)*sqrt(25+(n(1,i)-dz/2)+0.5)^2*dz; end but n has onl...

4 years ago | 0

Answered
Calculate Euclidean Distance between one point and many others
xyz=rand(3,10); %points Dist=vecnorm(xyz,2,1)

4 years ago | 0

| accepted

Answered
"Effectively" create subclass of cell array to eliminate overhead when constructing large object arrays?
If I were you, I would not use arrays of objects. I would hold all of your quaternion data as an MxNx4 member of a scalar object...

4 years ago | 1

| accepted

Answered
How to extract the coordinates of points/vertices in a curve?
f = 10; %define modulation frequency A = .2; % modulation amplitude t = linspace(0,2*pi,120)'; vertices=[cos(t),sin(t),A*...

4 years ago | 1

| accepted

Answered
Generate coordinates for plotting a hexagonal mesh with the nsidedpoly function
C=arrayfun(@edgesamp,1:6,'uni',0); C=vertcat(C{:}); x=C(:,1); y=C(:,2); n=numel(x); p0=nsidedpoly(6,'Radius',1); p=array...

4 years ago | 0

| accepted

Load more