Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cs251_group00
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
BHARAT KHANDELWAL
cs251_group00
Commits
e61d3d7b
Commit
e61d3d7b
authored
Aug 23, 2016
by
BHARAT KHANDELWAL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lab1
parents
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
Lab1.m
Lab1.m
+18
-0
No files found.
Lab1.m
0 → 100644
View file @
e61d3d7b
# Define Function:
function y = f (x)
# Read refractive indices from file
[a, b] = textread ("input_inlab_task_A1.txt", "%f %f");
# Calculate y
y = a * cos(x) + b * sin(x) + 4*(sin(x/3)^2) -3;
endfunction
# Comment: Solve System with guess as 1.01:
[x] = fsolve ("f", 1.01);
# Initiating file handle
fid = fopen ("output inlab task 01.txt", "w");
#Writing answer to file
fputs (fid, num2str(x));
fclose (fid);
\ No newline at end of file
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