Capulus_love
Followers: 0 Following: 0
Feeds
提问
How do I change string to double without changing number of zero under decimal point?
a = '24.5';aa = "24.5"; b = str2double(aa) d = double(a) d = double(aa) c = cast(aa,'double') c = cast(a,'double') i know ...
4 years 前 | 1 个回答 | 0
1
个回答提问
I have a question about using table
load patients whos Then the result shows Name Size Bytes Class Attributes A...
4 years 前 | 1 个回答 | 0
1
个回答提问
Code for 'Reverse a Vector'
v = [1 2 3 4 5]; w = reversal(v) %----------------------------------------------------------- function w = reversal(v) ...
4 years 前 | 6 个回答 | 0
6
个回答已回答
Write a function called get_distance that accepts two character vector inputs representing the names of two cities. The function returns the distance between them as an output argument called distance. For example, the call get_distance('Seattle, WA'
function distance = get_distance(a,b) [~,~,excel] = xlsread('Distances.xlsx'); col = excel(1,:); row = excel(:,1)...
Write a function called get_distance that accepts two character vector inputs representing the names of two cities. The function returns the distance between them as an output argument called distance. For example, the call get_distance('Seattle, WA'
function distance = get_distance(a,b) [~,~,excel] = xlsread('Distances.xlsx'); col = excel(1,:); row = excel(:,1)...
4 years 前 | 0
已回答
Write a function max_sum that takes v a row vector of numbers & n,a positive integer as inputs.The function needs to find n consecutive elements of v whose sum is largest possible.It returns summa & index of first element of n consecutive integers.
%why second problem doesn't run? function [summa,index] = max_sum(v,n) s = size(v); b = 0; c = 0; index = 0; ...
Write a function max_sum that takes v a row vector of numbers & n,a positive integer as inputs.The function needs to find n consecutive elements of v whose sum is largest possible.It returns summa & index of first element of n consecutive integers.
%why second problem doesn't run? function [summa,index] = max_sum(v,n) s = size(v); b = 0; c = 0; index = 0; ...
4 years 前 | 0
已回答
Write a function called valid_date that takes three positive integer scalar inputs year, month, day. If these three represent a valid date, return a logical true, otherwise false. The name of the output argument is valid. If any of the inputs is not
function x = valid_date(year,month,day) if nargin == 3 if isscalar(year) && isscalar(month) && isscalar(day) if ...
Write a function called valid_date that takes three positive integer scalar inputs year, month, day. If these three represent a valid date, return a logical true, otherwise false. The name of the output argument is valid. If any of the inputs is not
function x = valid_date(year,month,day) if nargin == 3 if isscalar(year) && isscalar(month) && isscalar(day) if ...
4 years 前 | 0