Please someone solve me error of matrix dimension for focal lengths equation
조회 수: 1 (최근 30일)
이전 댓글 표시
clear all;
close all;
clc;
n1=1.49;
n2=1:.1:2.42;
r1=.25;
r2=.50;
f=(((n1/n2)-1)*((1/r1)-(1/r2)))^-1;
fl=1/f;
plot(n2,fl);
xlabel('Refractive indices of surrounding material');
ylabel('Focal length');
title('Different focal lenths for varying refractive indices of different
materials')
댓글 수: 0
답변 (1개)
Walter Roberson
2017년 10월 23일
f = (((n1./n2)-1)*((1/r1)-(1/r2))).^-1;
fl = 1./f;
Though since the .^-1 is the same as 1/ I do not know why you do not just directly calculate
fl = (((n1./n2)-1)*((1/r1)-(1/r2)));
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!