Answered
Finding certain numbers in vectors
any(ismember(v1, nmbr)) any(ismember(v2, nmbr)) any(ismember(v3, nmbr)) If true, then the vector has any of these numbers [2 ...

4 years ago | 0

| accepted

Answered
Hello all! I have some ambiguity with MATLAB. I saved my matrix as A(:,:,1) in workspace. Now I want to access column or some entries of my big matrix on command window.
Do by following code for i=1:4 A(:,:,i)=i*ones(4,4); end B = permute(A,[3,2,1]); B(:,:,2) The result is ans = ...

4 years ago | 0

| accepted

Answered
Specify nature/type of property
First define the food class Then define meals class Now run meals in the command window, we get empty class meals with two...

4 years ago | 0

Answered
How to solve hyperbolic function ratio equation
you can solve it with symbolic expression syms z x y eq = y/z - tanh(x)/tanh(x/2); sol = solve(eq, x, 'ReturnConditions',true...

4 years ago | 0

Answered
Remove contour line from unwanted region
%%Example from other user x = -100:100; y = -100:100; inputData = rand(201); inputData(abs(x)<=10,abs(y)<=10) = nan; contou...

4 years ago | 0

| accepted

Answered
i want to detecting bubble in the image and measuring the size
Use DCT transformation and with a critical bw value I=double(imread ('image.bmp')); I = -(I-min(I(:)))/(min(I(:))-max(I(:))); ...

4 years ago | 0

| accepted

Answered
How to make a new table from two different table with common value?
result has the same row number as T1 or T2? result = table(C,'variablenames',{'datetime'}); result.value1 = T1.value(1:(size(r...

4 years ago | 0

Answered
How to export FEMesh?
The mesh is now the field of model you can get mesh by Mesh = model.Mesh; % nodes are obtained by Nodes = Mesh.Nodes; % d-b...

4 years ago | 0

| accepted

Answered
In solving ordinary differential equations of elasticity, I got the following hint“Unable to find symbolic solution”.How should I modify the solution
That means matlab can not find symbolic solution for the ode with the given boundary condintions (Given values at two ends). Ta...

4 years ago | 0

Answered
Strings to variable names
Hi, try following code results{:,'X'} = results{:,'Sigma'}; results(:,'Sigma') = []; results{:,'Y'} = results{:,'LR'}; resul...

4 years ago | 0

| accepted

Answered
Euler's method
Hi, Use y(i+1)=y(i)+ h*(((sin(2*x(i)))/x(i)^2)-(2*y(i)/x(i))); instead of y(i+1)=y(i)+ h*(((sin(2*x))/x^2)-(2*y/x));

4 years ago | 0

Answered
Please help me. I really need help with copula.
use corrcoef is ok, returns the matrix of correlation coefficients for A, where the columns of A represent random variables an...

4 years ago | 0

Answered
how to loop a equation.
Why use symbol? R=8.314; T=[600:50:800]; D=0.27*(1.04/-0.22)*exp((-246)./(R*T)) The D array is good to use D = -1.2149...

4 years ago | 0

| accepted

Answered
Rotation of Ellipse to a specific vector
By following operator you will get what you want clc;clear blueLine = [-0.4, 0.8, 0]; % direction of blue line xc = 1; yc =...

4 years ago | 0

| accepted

Answered
Euler's Method
Euler forward? clc;clear odefun = @(x,y) x^(-2) *(sin(2*x)-2*x*y); % I have rewritten the ode function xspan = [1,2]; x0 = x...

4 years ago | 0

Answered
Graph in tiff format : how to interchange X and Y axis ?
I usually use GetData software. while with matlab, I wrote code for this problem below % Extract data from image clc;clear fi...

4 years ago | 0

Answered
linear interpolation in 3D space
Using point2segmentDistance function function [distance, nearestPointOnSeg ]= point2segmentDistance(point, segmentPoint1, segme...

4 years ago | 1

| accepted

Answered
Construct the statement on MATLAB: If a person has more than 10 apples then he will sell 8. But if he has less than 10 apples than he will sell 5 apples
apples_left = 20; % total apples at the beginning while true if(apples_left<5) break; end if(apples_left>10...

4 years ago | 0

Answered
How do I calculate acceleration when I have instantaneous values of velocity?
Use pddiff function attached here, this is easy to use. t = linspace(0,3*pi,19)'; f = sin(t); % assume this is the velocity [...

4 years ago | 0

| accepted

Answered
Deleting Some Specific Entries from a vector
Just do with the following q = abs(yb); p = (q==0|q==1|q==0.6|q==0.8); xa = yb(~p) if it does not work, use a tolerance TO...

4 years ago | 0

| accepted

Answered
how to convert picoscope data to matlab
Why not save with csv extension. IF you can open with MS access, just use save as, and convert to csv file. matlab can read csv ...

4 years ago | 0

Answered
how to convert explicit function to implicit?
If you feel bored solving it by hand, just use matlab! syms a y x b A eq = a*y - x*(a+1) - A*(x^2-b*a^2*(y-x)^2); y = solve(e...

4 years ago | 1

| accepted

Answered
How to concatenate two matrices?
A=[1 2;3 4]; B=[5 6;7 8]; C1 = [A,B]'; C = reshape(C1, size(A,2),numel(C1)/size(A,2))' Then C = 1 2 5 ...

4 years ago | 1

| accepted

Answered
Subgraph from selected edges
hi, friend, you can make EdgeNumber an array that contains all the edge numbers that you are interested in. and make the line ...

4 years ago | 1

Answered
How to make the array automatic shift to next column after looping
Use following command total_five_output = zeros(8752,5); for i = 1:1:5 % .... % your body to generate output total_...

4 years ago | 0

| accepted

Answered
Rotate geometry at one specified point
Here I added the rotation method for you function Nano_Sphere_Dat_Generator clear clc clf %set value of geometric paramete...

4 years ago | 1

Answered
Partitioning a number into sum of positive real numbers
Hi, friend! I have thought of a search method that saves much time. Firstly, the problem can be converted to V = 1:1:M, there ...

4 years ago | 0

| accepted

Answered
Subgraph from selected edges
Note that all the endnodes of some given edges may be repeated, as commented by @Sim. Unique is a good way to solve such problem...

4 years ago | 1

| accepted

Answered
Runge kutta method matlab
Use arrayfun to obtain your solutions and Plot them! x0y0 = [20x2] array? tspan = [0:dt:t_end]; [tsol, xysol] = arrayfun(@(i)...

4 years ago | 0

Load more