Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cs251_group22
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JEYASOORYA S
cs251_group22
Commits
02b36d57
Commit
02b36d57
authored
Aug 23, 2016
by
JEYASOORYA S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commited lab1_inlab
parents
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
refraction.m
refraction.m
+15
-0
No files found.
refraction.m
0 → 100644
View file @
02b36d57
#function whose root is to be found
function y = f(x)
#reading from the input file
A = load('input_inlab_task_A1.txt');
y = sin(x)-A(1,1)*sin(x/3)*cos(x)-A(1,2)*sin(x/3)*sin(x);
endfunction
#solving f(x) = 0
[p, info] = fzero("f",[0.00001 1.67]);
#writing into output file
fid = fopen ("output_inlab_task_01.txt","w") ;
fprintf(fid, "%f", p);
fclose(fid);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment