Gistlib Logo

gistlib

add the first 20 elements of a table of 100 elements in matlab

main.m
% Create a table with 100 elements
table = rand(100, 1);

% Add the first 20 elements
result = sum(table(1:20));
disp(result);
127 chars
7 lines

similar matlab code snippets

how to calculate the 99th percentile in matlab
how to calculate cumulative distribution function in matlab
how to calculate the binomial distribution in matlab
how to perform a ztest in matlab
how to plot the binomial distribution in matlab
how to calculate the normal distribution in matlab
calculate the area of a triangle in matlab
calculate the area of a sphere in matlab
find the slope of a set of points in matlab
calculate the volume of a pyramid in matlab

related categories

matlab

gistlibby LogSnag