Matlab Basics II - Free Fall
An object freely falling from rest under gravity covers a distance x given by:
x = 1/2 gt^2
write a function that calculat...
約7年 前
解決済み
MATLAB Basic: rounding II
Do rounding nearest integer.
Example: -8.8, answer -9
+8.1 answer 8
+8.50 answer 9
約7年 前
解決済み
Number of Circles in a Number
Given a number, return the number of closed 'circles' in the base 10 numerical representation.
Note: the number 4 has no circ...
Count ones
Write a program to count number of ones (1s) in an integer variable input.
For example:
Input x=2200112231
output y=3
I...
約7年 前
解決済み
Sum the Digits of a Number
Given an integer, sum the digits repeatedly until you end up with a single value less than 10.
For example, if you add the di...
Getting the absolute index from a matrix
This is a basic MATLAB operation. It is for instructional purposes.
---
You may already know how to get the <http://www.ma...
約7年 前
解決済み
Sum of Two Numbers
Given two integer numbers x and y, calculate their sum and put it in z.
Examples:
Inputs x = 2, y = 4
Output z is 6
...
約7年 前
解決済み
Flip the vector from right to left
Flip the vector from right to left.
Examples
x=[1:5], then y=[5 4 3 2 1]
x=[1 4 6], then y=[6 4 1];
Request not ...
約7年 前
解決済み
Matlab Basics II - squares
Write a function that takes matrix A, and squares each element in the matrix
example:
A = [1 2 3]
output = [1 4 9]
MATCH THE STRINGS (2 CHAR) very easy
Match the given string based on first two characters on each string.
For example
A='harsa';
b='harish'; result '1'
...
Convert Fahrenheit to Celsius
Calculate the Celsius temperature C given the Fahrenheit temperature F.
Examples:
Input F = 90
Output C is 32.22
I...
約7年 前
解決済み
Back to basics 19 - character types
Covering some basic topics I haven't seen elsewhere on Cody.
Return the number of punctuation characters in the input variabl...
約7年 前
解決済み
Matlab Basics II - Minimum
Write a function that returns the minimum of each ROW of a matrix x
example: x = [1 2 3; 4 5 6];
output [1;4];
約7年 前
解決済み
Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places:
e.g. x = 2.3456 --> y = 2.346