嗨,新朋友,很高兴认识你,欢迎来到我的博客。
分类存档: matlab

Matlab计算阶乘的程序(if,for,while)

1、while语句版,首先建立函数并保存为jiecheng.m function sum=jiecheng(n) n=input(‘please enter a positive number’); if n<0     display(‘输入的是负数’) else ...

Matlab实现两个变量交换数值(不使用第三个变量)

以前一个教授在听C语言公开课时对一个老师提出来的,现在把C换成Matlab软件,看大家如何解决。 程序: syms x y x=input(‘please enter a number x:’); y=input(‘please enter a number y:’); x...