Getting an error For colon operator with char operands, first and last operands must be char.

2 views (last 30 days)
Joshua Meyer
Joshua Meyer on 16 Nov 2021
Edited: Stephen on 17 Nov 2021
Im getting an error called "Error using : For colon operator with char operands, first and last operands must be char." I have the code that im trying to use for reference. I asked my professor about it and he doesnt have a solution for me and suggested me to talk to someone that might here.
  3 Comments
Joshua Meyer
Joshua Meyer on 17 Nov 2021
clear
clc
k=.0004
Re=2.*10.^6
F=@(f) -.86*ln((k./3.7)+(2.51./Re.*sqrt(f)))-sqrt(1/f)
j=('Input number of crossings =')
for i=1:j
f=input('the approxmate f where F is zero =')
fzero(F,f)
end
This is the code i have that results in the error

Sign in to comment.

Answers (1)

Stephen
Stephen on 17 Nov 2021
This line
j=('Input number of crossings =')
should be
j = input('number of crossings =')
  3 Comments

Sign in to comment.

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!