Answered
Error using Zeros, size input must be integers.
Qd=zeros(round(size(Q,1)/24),length(A));
for i=1:length(A)
for d=1:round(size(Q,1)/24)
bk=Q(1+24*(d-1):24*d,i);
...
7 hours ago | 0
| accepted
Answered
Guess the which of the below given statements are true for function polyfit?
Instead of posing an easy question here, you can go to the documentation and check it yourselves.
https://in.mathworks.com/hel...
11 hours ago | 0
Answered
Finding and saving slopes of individual lines generated using for loop
hold on
for i=2:2:6
j=i-1
plot(T(:,j),T(:,i))
end
hold on
slope = zeros([],1) ;
count = 0 ;
for i=2:2:6
...
12 hours ago | 1
| accepted
Answered
How can I use summation and product, simultaneously???
Something like this:
m = 2 ; % i
n = 3 ; % j
C = rand(m,1) ;
k = rand(m,n) ;
M = rand(m,n) ;
iwant = zeros(m,1) ...
13 hours ago | 0
Answered
my program is not working and i don't know why ?
When you are writitng lines of code in next line use ........, you cannot split the number to next line. Also your code need ini...
13 hours ago | 0
Answered
Could MATLAB do text-mirroring?
I = imread('image.png') ; % read image
I1 = fliplr(I) ; % flip the image
imshow(I1)
13 hours ago | 0
Answered
Index value intersection query in matlab
a = round (x);
b = round (y);
for k = 1:length(a)
index (k,:) = rms(b(k),a(k));
end
index = index';
1 day ago | 0
| accepted
Answered
Error in dlmwrite (line 181)
Read about writetable https://in.mathworks.com/help/matlab/ref/writetable.html
1 day ago | 1
| accepted
Answered
trying to integrate and differentiate a graph
clear
corner=[-2 0 ;-1 1;1 1;3 4;4 2;7 0;8 0];
%plot(corner);
x=[-3 ;-1; 1; 3; 4;8];
y=[0 ,1 , -2, 4, 2,0];
% diffrent...
1 day ago | 0
Answered
Replacing all even numbers in my matrix with their square root value
A=[1 4 9; 8 16 7; 3 36 4]
idx = mod(A,2) ;
A(idx==0) = sqrt(A(idx==0))
3 days ago | 0
Answered
How to plot "f(x,y) = x^2 * y^3" and its partial derivative function in matlab?
x = linspace(-1,1) ;
y = linspace(-1,1) ;
[X,Y] = meshgrid(x,y) ;
f = X.^2.*Y.^3 ;
dfdx = 2*X.*Y.^3 ;
dfdy = 3*X.^2.*Y.^...
4 days ago | 0
| accepted
Answered
How can we generate random points in a cylinder of given height and radius using interpolation ?
Radius = 1. ; % Radius of the cylindrical shell
theta = 2*pi ; % Angle of the Cylinder
Height = 5. ; ...
4 days ago | 1
Answered
How can i correct this error "Parse error ´(´"
x=A*sin(w*t+fA);
y=B*cos(w*t+fB);
if fB==0
y=(B/A)*x;
elseif fB==pi/2
y=sqrt(B.^2*(1-((x.^2)/A.^2)));
elseif fB==p...
6 days ago | 0
| accepted
Answered
Struggling to connect end points of lines within a plot
L = [0 -1; 0 0 ; 0 1 ; 0 2 ] ;
R = [0 -1; 2 0 ;1 1 ; 2 2] ;
plot(L(:,1),L(:,2),'r')
hold on
plot(R(:,1),R(:,2),'r')
plo...
6 days ago | 0
| accepted
Answered
how to remove or cut off few data points in distance and elevation vector in up and down inorder to work only with the overlapping part ?
Use logical indexing and pick the points/ remove th points which you don't want.
EXample:
A = rand(1,100) ;
A(A<0.5) % pi...
6 days ago | 0
| accepted
Answered
Remove items from 3D Matrix with 2D mask for each timestep
% data
A(:,:,1) = [1 2
2 4] ;
A(:,:,2) = [5 2
2 3] ;
B = [1 2
NaN 1] ;
B_mask = r...
6 days ago | 0
| accepted
Answered
netcdf files in a predefined domain
Something like this should work:
index_out_edge = ~(((sub_lat(:)<=lat_edge(1) | sub_lat(:)>=lat_edge(2)) && (sub_lon(:)<=lon_e...
6 days ago | 0
Answered
Subtract matrices in an array 'A' with elements from matrix 'B'
iwant = cell(size(A));
for i = 1:length(A)
iwant{i} = A{i}-B(i,:) ;
end
6 days ago | 0
Answered
setting up a matrix
https://in.mathworks.com/matlabcentral/fileexchange/73840-itruss?s_tid=srchtitle
https://in.mathworks.com/matlabcentral/fileex...
7 days ago | 0
Answered
saving a matrix of each loop
You can save them into a cell as shown below.
iwant = cell([],1) ; % initilize a cell array;
while(fin)
% made sep...
7 days ago | 0
| accepted
Answered
Permutation function for distance measure
You can get the distances between each pair using pdist. From this you can make decision.
v = [1 2 3];
P = perms(v)
d = pd...
7 days ago | 0
Answered
How do I use the values of the vector in the for loop
p = [.1 1. 2. 1.25 .35];
P = zeros(length(p)) ;
for i = 1: length (p)
for j = 1: length (p)
P (i, j) = p(i) * p(j);...
7 days ago | 0
Answered
How can i change a cell to an array?
C{1} = rand(2,2,2) ;
C{2} = rand(2,2,2) ;
C{3} = rand(2,2,2) ;
C{4} = rand(2,2,2) ;
A = cat(4,C{:}) ;
C{1}
A(:,:,:,1)...
7 days ago | 0
| accepted
Answered
How to remove unwanted points in point cloud
You can see that the unwanted points are lying in certain intervel of (x,y,z). Get those indices using logical indexing and remo...
7 days ago | 0
Answered
what code could possibly solve this problem?
You need to put a closed bracket at the end ')' in the last term.
yy.data(:,4) * (yy.data(:,4))
But I suspect, there will be ...
8 days ago | 0
| accepted
Answered
How do I fill 3D planes with a pattern?
Have a look on this. https://in.mathworks.com/matlabcentral/fileexchange/2075-hatch-m
8 days ago | 0
Answered
Slow for loop string comparison
Obviously what you have shown will be dead slow and also may not work.
You can striaght aways use strcmp, contains. Read about...
8 days ago | 0
Answered
How can I get operating the code vector computing with different size matrix
Read about logical indexing. Pick the points or x which are not zeros and do the operations on only those points ignoring the po...
9 days ago | 1
| accepted