CIVE121 Study Guide - Interpolation, Printf Format String, Numerical Integration

65 views1 pages

Document Summary

[value_max, index] = max(vec) array = rand(5, 2) Vector functions total = sum(vec) num = length(vec) array = randi([1, 6], 5, 2) Find and logical index = find(logical expression) index = findstr(target_string, search_string) Character arrays string = num2str(numeric value) numeric value = str2num(character vector) Cell arrays cell = {elements} element = cell{index} string = char(cell{index}) = textread(filename, "%s%f etc. ") numeric_array = dlmread(filename) fid = fopen(filename) cell_array = textscan(fid, "%s%f%f") fclose(fid) I = trapz(x_vector, y_vector) dydx_vector = gradient(y_vector, x_vector) der_coeff = polyder(coeff) int_coeff = polyint(coeff) Interpolation y_interp = interp1(x, y, x_interp, "linear") y_interp = interp1(x, y, x_interp, "spline") Polynomials y_vector = polyval(coeff, x_vector) coeff = conv(coeff1, coeff2) coeff = polyfit(x_vector, y_vector, degree) Optimization and root finding r_vector = roots(coeff) r = fzero(fhandle, guess) r = fzero(fhandle, [l1, l2]) Plotting subplot(r,c,z) plot(x_vector, y_vector, format string) loglog(x_vector, y_vector, format string) semilogx(x_vector, y_vector, format string) semilogy(x_vector, y_vector, format string) fplot(fhandle, [x1, x2]) ezplot(symbolic_expression, [x1, x2]) ezplot(symbolic_expression, symbolic_expression, [t1, t2]) plot3(x, y, z)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers