求大神将下面的c语言改成能在Matlab上运行的!急!急!#include intdays[2][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31}, {0,31,29,31,30,31,30,31,31,30,31,30,31}};char s[8][10] ={"Monday","Tuesday","Wednesday","Thursday","F

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/18 12:13:00
求大神将下面的c语言改成能在Matlab上运行的!急!急!#includeintdays[2][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31},{0,31,2

求大神将下面的c语言改成能在Matlab上运行的!急!急!#include intdays[2][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31}, {0,31,29,31,30,31,30,31,31,30,31,30,31}};char s[8][10] ={"Monday","Tuesday","Wednesday","Thursday","F
求大神将下面的c语言改成能在Matlab上运行的!急!急!
#include

intdays[2][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31},
{0,31,29,31,30,31,30,31,31,30,31,30,31}
};
char s[8][10] ={"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};

bool is_leap(int year)
{
return (year%4==0 && year%100) || (year % 400 == 0);
}

int DateToInt(int year,int mon,int day)
{
int ans=0,t=is_leap(year) ? 1 : 0 ;
for(int i=1 ; i

求大神将下面的c语言改成能在Matlab上运行的!急!急!#include intdays[2][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31}, {0,31,29,31,30,31,30,31,31,30,31,30,31}};char s[8][10] ={"Monday","Tuesday","Wednesday","Thursday","F
程序如下,已经做子函数处理,所以请放在一个m文件中运行:
function [] = myhelp()
clear;
clc;
week = ['Monday ';'Tuesday ';'Wednesday';'Thursday ';'Friday ';'Saturday ';'Sunday '];
week = cellstr(week);
%printf('Input the date (eg 2013 10 21 , -1 ends the input):\n');
year = input('Input year:');
mon = input('Input month:');
day = input('Input day:');
myday = DateToInt(year,mon,day);
cxd = mod(myday+6,7);
disp('six days later is:')
disp(week(cxd))
function myday = DateToInt(year,mon,day)
days =[31,28,31,30,31,30,31,31,30,31,30,31;31,29,31,30,31,30,31,31,30,31,30,31];
myday = 0;
t = is_leap(year);
for ii = 1:year-1
myday = myday + is_leap(ii)*366+(1-is_leap(ii))*365;
for jj = 1:mon-1
myday = myday + days(t+1,jj);
end
end
myday = myday + day;
function isleap = is_leap(year)
isleap = (mod(year,4)==0 && mod(year,100)~=0) || (mod(year,400)==0) ;

实例:
Input year:2013
Input month:10
Input day:22
six days later is:
'Monday'

有问题可以追问
copyright (c) cxd1301

求大神将下面的c语言改成能在Matlab上运行的!急!急!#include intdays[2][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31}, {0,31,29,31,30,31,30,31,31,30,31,30,31}};char s[8][10] ={Monday,Tuesday,Wednesday,Thursday,F 求matlab大神将以下公式按matlab的语言写出来,小弟在此感激不尽! 哪位大神能告诉我怎样用matlab实现下面的公式 求问C语言大神!下面图A选项和B选项的区别是? matlab 中求余在C语言里%表示求余 在matlab中%还是表示求余吗? matlab语言编写下面的公式 手机里面的英文字,怎么改成中文的?求大神帮助设置语言里面没有, C语言:输入一个英文句子,要求将每个单词的第一个字母删除.求大神帮助编程 matlab的interp2函数怎么移植到C语言?求大神指点详细算法或者使用matlab coder转换的详细过程,还或者封装成dll的详细过程? 求大神用matlab画出下面的图形,类似的也行 MATLAB 画图求大神帮忙给出下面两个图形的画法 求大神用matlab语言帮我完成下面的题目 谢谢11. 绘制函数曲线,要求写出程序代码 (1)在区间[0:2π ]均匀的取 50个点,构成向量π (2)在同一窗口绘制曲线 y1=sin(2*t-0.3); y2=3cos(t+0.5);要求 y1曲线为红 matlab与C语言的区别是什么? C语言求助:输入一个英文句子,将每个单词的第一个字母改成大写字母. 求matlab大神呀.请将1-10之间的自然数,分为两组,一组为偶数、一组为奇数.【得分:】求大神用matlab做出来 求大神帮画个C语言流程图 求大神做这几道C语言题.只做四题就行. 求C语言大神指导第三题