답변 있음
Repeating the rows of an array by a number given by another array
x=[linspace(1,4,4)' linspace(5,20,4)'] ; I=[2 3 2 1]' ; C = cell(length(I),1) ; for i = 1:length(C) C{i} = repmat(x(i,:...

4년 초과 전 | 1

답변 있음
Summing the elements of an array while maintaining its size
a=[0 2 2 6]; Ineed=cumsum(a)

4년 초과 전 | 0

답변 있음
How to store data in each iteration
yy = cell(length(list),1) ; p=bwlabeln(mask==1); list=unique(p)';list(1)=[]; figure('color','w'); hold on for i=list ...

4년 초과 전 | 0

답변 있음
how to save array in different dimension
REad about initializing. ri = zeros(length(x),1) ; for i = 1:length(x) ri(i)=sqrt(((x(i)-xs)*111.1)^2)+(((y(i)-ys)*85.3)...

4년 초과 전 | 0

| 수락됨

답변 있음
How do I select the minimum value from the first column based on the corresponding value in the second column?
Let A be your data. A = [1 1; 22 1; 3 0 ; 5 0; 60 1; 76 0; 7 0; 12 0] ; iwant = min(A(A(:,2)==0,1))

4년 초과 전 | 0

| 수락됨

답변 있음
Prevent variables from displaying after fprint
Comment those lines which you don't want to display. Comment is %

4년 초과 전 | 0

답변 있음
I am trying to use an input for x and find e^x-1 and am enetering it as y=exp(x)-1 but it keeps just giving me the answer -1
If you have doubt youmay check with vpa (variable precision arithmetic). y = vpa(exp(-12)-1)

4년 초과 전 | 1

답변 있음
How to attribute intersection points between poly and lineseg to poly
You can use inpolygon. This will show your points lying on and inside the circle.

4년 초과 전 | 0

답변 있음
how to store time loop i creat save matrix but stored only that last iteration at final time
% timestep time = zeros([],1) ; % variable to save time t=ti;%intitial time step count=1; time(count) = t ; while t < t...

4년 초과 전 | 0

답변 있음
Curve fitting for 2d Array
If (x,y) are the points of your curve... m = gradient(y)./gradient(x) ; % diff(y)./diff(x)

4년 초과 전 | 1

답변 있음
How do I program dy/dx+(sinx)cosy into matlab I am having trouble figuring out how to make it work. Thank you
syms y(x) eqn = diff(y,x)+sin(x)*cos(y)==0 s = dsolve(eqn)

4년 초과 전 | 0

답변 있음
How to flip Y axis title?
figure xlabel('xlabel') yyaxis left ylabel('First y-axis title') yyaxis right ylabel('Second y-axis title') ylh = get...

4년 초과 전 | 0

| 수락됨

답변 있음
How to create a matrix with while loop?
vol=20; A=3000; t = 0; m = zeros([],2) ; iter = 0 ; while vol>0 iter = iter+1; t=t+0.10; vol=A-vol*t; ...

4년 초과 전 | 1

| 수락됨

답변 있음
Count number of words in a PDF document.
You can read your pdf file using: str = extractFileText("Test.pdf"); % give your pdf name The above will read the conent of p...

4년 초과 전 | 1

답변 있음
How to change only certain numbers in a matrices for a certain iteration?
A = [1 0 0 0 0 0 1 0 0 0; 0 0 0 0 0 0 0 1 0 0; -1 0.707 0 0 -0.707 0 0 0 0 0; 0 -0.707 0 0 -0.707 -1 0 0 0 0; ...

4년 초과 전 | 0

답변 있음
plot figures using a for loop and subplot function
If you want in two different figure: figure(1) for i = 1:15 subplot (5,3,i) plot (outdoor_temp,D(:,i), "r *") ...

4년 초과 전 | 2

답변 있음
Area of a signal
Read about trapz.

4년 초과 전 | 0

| 수락됨

답변 있음
Combine two excel files with different row and column lengths into one excel file
T1 = readtable('Dummy_A.xlsx') ; T2 = readtable('Dummy_B.xlsx') ; T3 = readtable('Dummy_Example.xlsx') ; DAY = T1.DAY ; H...

4년 초과 전 | 0

답변 있음
find matrix X by equation
You can solve the equation using symbolic toolbox to get X and then substitute A into the obtained solution. syms a x eqn = ...

4년 초과 전 | 0

| 수락됨

답변 있음
How to create a matrix array with increments equation using vectorization?
s=0.1; y=pi; x=[1:1:5]'; % transpose this area=s.*sqrt(y.*x); vol=s.*y*sqrt(y.*x); B=[x area vol]; size(B)

4년 초과 전 | 1

| 수락됨

답변 있음
deleting table above a specific row
% Demo example x = (1:100)' ; y = rand(size(x)) ; T = table(x,y) ; % remove rows which have values greater than 0.7 values...

4년 초과 전 | 1

답변 있음
For loop Index exceeds the number of array elements.
% Script for finding the limits of a f(x) as 'x' approaches 'a' % first table is from left % second table is from right clc ...

4년 초과 전 | 0

답변 있음
Unable to use logical indexing
rng(117) M1 = rand(100,200); idx = M1(:,2) > 0.9 % this will give you logical indexing ele = M1(idx,2) % this will give ...

4년 초과 전 | 0

답변 있음
How can i display the table results vertically?
MAke the arrays as column dominant. Ma(i,1) = input ('put the mach number');

4년 초과 전 | 0

| 수락됨

답변 있음
Finding closest points between two gpx file (GPS points which has error and desired GPS points)
You can use the function knnsearch. https://in.mathworks.com/help/stats/knnsearch.html

4년 초과 전 | 0

답변 있음
fill the land in coasts.mat without M_Map
load('coasts.mat') M = [Lon' Lat'] ; idx = all(isnan(M),2); idr = diff(find([1;diff(idx);1])); D = mat2cell(M,idr(:),size...

4년 초과 전 | 0

| 수락됨

답변 있음
Plotting values from a function in different script
You have to define the required input variables first and then call the function. L = 1. ; nmax = 100 ; numpoints = 1000 ; [...

4년 초과 전 | 1

| 수락됨

답변 있음
How do I get an array of deviations from 0 or 2 pi radians from an array of bearings ranging 0 to 2 pi?
You can calculate the Euclidean distance. Read about pdist. You can calculate difference along x and y axes, read about diff, gr...

4년 초과 전 | 0

답변 있음
Can I plot geographic data defined on a triangular mesh on a map axes object?
You can convert your triangular data into structured using griddata. After converting into a grid you can use surfm. Read abou...

4년 초과 전 | 0

더 보기