Please someone solve me error of matrix dimension for focal lengths equation

조회 수: 1 (최근 30일)
Soham Jadhav
Soham Jadhav 2017년 10월 23일
답변: Walter Roberson 2017년 10월 23일
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')

답변 (1개)

Walter Roberson
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)));

카테고리

Help CenterFile Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by