Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cs251_group04
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
SHAH DEVANSH
cs251_group04
Commits
2dfb3cae
Commit
2dfb3cae
authored
Aug 23, 2016
by
ARCHIT GUPTA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added inlab 1
parents
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
refraction.m
refraction.m
+20
-0
No files found.
refraction.m
0 → 100644
View file @
2dfb3cae
%function that loads a file and parses variables from it
function
y
=
f
(
x
)
myfile
=
load
(
"input_inlab_task_A1.txt"
);
nx
=
myfile
(
1
);
ny
=
myfile
(
2
);
y
=
(
nx
*
cos
(
x
)
+
ny
*
sin
(
x
))
*
sin
(
x
/
3
)
-
sin
(
x
);
endfunction
% fsolve directly returns the value of unknown in an equation.
[
x
,
info
]
=
fsolve
(
"f"
,
pi
/
6.0
);
disp
(
x
);
myfile2
=
fopen
(
" output_inlab_task_01.txt"
,
"w"
);
% fdisp writes to the output file
fdisp
(
myfile2
,
x
);
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