Answered
how do i write a matlab script to sum this expression?
N = 100; thesum = 0 ; for i = 1:N thesum = thesum+(1/i+1/((i+2)*(i+3))) ; end Without Loop: N = 100 ; f = @(i) (1....

6 years ago | 1

| accepted

Answered
how to find argmin to this vector
Are you looking for something like this? Let a,b be your column matrices. [a,b] = meshgrid(a,b) ; % make them a matrix F ...

6 years ago | 0

| accepted

Answered
How to Swap Column according to odd/even numbers?
This is basic in MATLAB. You should read about indexing an array. Example: A = rand(10,1) ; % array for demo E = A(2:2:end...

6 years ago | 0

Answered
How to get the Z-contour values related to scatter positions?
Read about ScatteredInterpolant.

6 years ago | 0

| accepted

Answered
Given that a=[1;4.2;3;pi;8;7;62;50;23;17]; Please use vector b to represent all the even elements in vector a (b=[8;62;50])?
Use mod to get your even numbers. a = [1; 4.2; 3; pi; 8; 7; 62; 50; 23; 17]; idx = mod(a,2) ; iwant = a(idx==0)

6 years ago | 0

Answered
Can anyone tell what is this line doing
f = [1 2 4]; % this is an array can be access by f(i) where i = 1,2,3 d = {[4 2 1] [4 1 2] [4 3 5]}; % this is a cell array,...

6 years ago | 0

Answered
How to obtain a group of pixels on an image
If I is an image, you can use: iwant = I(1:5:end,1:5:end,:) ;

6 years ago | 0

| accepted

Answered
Plotting a kind of tree
x1 = -22.5; x2 = -37.5 ; y1 = 0; y2 = 15; x = [x1, x2, x2, x1, x1]; y = [y1, y1, y2, y2, y1]; xC = 30; yC = -30; xR = ...

6 years ago | 2

Answered
Receiving x and y coordinates of an image.
I = imread("image.jpeg") ; [y,x] = find(I~=255) ; coor = [x y] ;

6 years ago | 0

| accepted

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
The error is clear; when you try to save more number of elements in an array which initiliazed with less number. Example: A ...

6 years ago | 1

| accepted

Answered
loops and divisions by 7 and calling function
function [whatsLeft, divisionCount] = divideBySeven (number) % Enter the code for your function here. while number <1 ...

6 years ago | 1

| accepted

Answered
Sign Changes (conditional through vector elements)
Refer here: https://de.mathworks.com/matlabcentral/answers/231803-how-to-determine-sign-change-in-a-matrix-for-each-coulmn-sep...

6 years ago | 0

| accepted

Answered
Need help finding coordinates of an image.
The image will be plotted wrt it's indices. If I is your image. [m,n,p] = size(I) ; x = 1:n ; y = 1:m ; [X,Y] = meshgrid(x,...

6 years ago | 1

| accepted

Answered
Creating an 8x8 matrix using loops
Hints: 1. You can generate the number array using ':'. If I want numbers from 1 to 36. I will use l = 1:36 ; 2. Once numebrs...

6 years ago | 0

Answered
Shortening run time to compute function
This function: function matrix=function1(n) matrix=zeros(n); for i=1:n for j=1:n matrix(i,j)=sqrt(2/n)*si...

6 years ago | 0

Answered
draw a line to where the area approach?
a = 1 ; i = 1:20 ; area = zeros(size(i)) ; for i = 1:20 a = a + a ; area(i) = (a *(1/8).^i) ; end i = 1:20 ; ...

6 years ago | 0

Answered
How to find the intersection points in a multidimensional array
Read about ismember. You can use ismemebr for each marix by running a loop. For the present given matrices: A(:,:, 1) = [4 5; ...

6 years ago | 0

Answered
How can i get the value of the theta i get after transforming it from rectangular to polar, cause i need the theta to convert it again to rectangular?
x = rand+1i*rand ; % convert from cartesian to polar [theta,r] = cart2pol(real(x),imag(x)) ; % the above function is nothin...

6 years ago | 0

| accepted

Answered
I'm keep having an error 'Not enough input arguments' for this code
It looks like you have opened the function and run the code by pressing F5 key or run button in the editor. This is not the way ...

6 years ago | 0

| accepted

Answered
How to get the index from the biggest to the smallest values of array ?
Read about sort. [val,idx] = sort(Ranking,'descend') ;

6 years ago | 1

Answered
why my graph is not showing any thing ?
Check this line: p = 1 ; x=0:p:0.5; The above shpuld be repalced with proper value p. Now it will create only one value i.e...

6 years ago | 1

Answered
Interpolated gridded data with limits
Don't transpose the ZData. Try: pcolor(lon1,S_latitude,sum_pd) If you still face a porblem or if you get an error. Read about ...

6 years ago | 0

Answered
Question : matlab 3D imagesc
Read about scatter, scatter3.

6 years ago | 0

| accepted

Answered
Modal analysis, Eigenvectors matrix plot
Read about plot. Refer this: https://de.mathworks.com/matlabcentral/fileexchange/30970-natural-frequencies-buckling-loads-of-...

6 years ago | 0

Answered
Is NaN ok here?
You have alph_entropy output as 1. log2(1) will be zero and when it is divided i.e. when it is denominator; you will get NaN.

6 years ago | 0

Answered
How to find the normal derivative of pressure data
Read about the function gradient

6 years ago | 0

| accepted

Answered
loop iteration in matlab
x = 10 ; thesum = 0 ; for i = 1:x thesum = thesum+sum((1:i).^5) ; end

6 years ago | 0

| accepted

Answered
Error using plot Vectors must be the same length.
% Given V_0 = 1.8:0.2:3.0; %m/s alpha = 18:1.0:24; %deg n=[]; for e = [0.40, 0.45, 0.50] k=((log(0.5.*tan(alpha)+1.47...

6 years ago | 0

| accepted

Answered
How to plot points from a geometric transformation matrix?
clc clear n=input('Enter the number of vertices') for i=1:n x(i)=input('Enter the x coordinate'); y(i)=input('Enter...

6 years ago | 0

| accepted

Answered
How do I add ones after each element in a vector?
You are appending the one's at the end, so according to your code the output given is correct. To get what you want follow: xda...

6 years ago | 0

Load more