精华内容
下载资源
问答
  • matlab:sin函数

    千次阅读 2020-02-12 00:00:00
    可以发现sin(pi)或者cos...由于sin,cos,tan等输入的参数为弧度制,而一般习惯角度制,所以解决的办法之一是用另外的函数,sind,cosd,tand等输入参数为角度制,就不会出现上述问题了。 sind(90) ans = 1 ...

    可以发现sin(pi)或者cos(1/2*pi)不等于0,初步推测应该是浮点运算的精度问题。由于sin,cos,tan等输入的参数为弧度制,而一般习惯角度制,所以解决的办法之一是用另外的函数,sind,cosd,tand等输入参数为角度制,就不会出现上述问题了。

    sind(90)
    ans = 1

    展开全文
  • matlab三角函数用法

    千次阅读 2019-07-29 22:05:54
    matlab里三角函数有sin,cos,tan,csc,sec和cot,是弧度制;...sind,cosd,tand是角度制; 如,sind(90)=1; asin,acos,atan是弧度制反三角函数; asind,acosd,atand是角度制反三角函数; sinh,cosh,tanh是双曲函数 ...

    matlab里三角函数有sin,cos,tan,csc,sec和cot,是弧度制;
    如,sin(pi/2)=1;

    sind,cosd,tand是角度制;
    如,sind(90)=1;

    asin,acos,atan是弧度制反三角函数;

    asind,acosd,atand是角度制反三角函数;

    sinh,cosh,tanh是双曲函数

    展开全文
  • MATLAB数学函数

    2018-07-25 00:27:42
    角度值三角函数:sind、cosd、tand、cotd、secd、cscd; 弧度制反三角:asin、acos、atan、acot、asec、acsc; 角度值反三角:asind、acosd、atand、acotd、asecd、acscd; 双曲函数:sinh、cosh、tanh、coth、se...

    数学函数

    1.三角类型

    弧度制的三角函数:sin、cos、tan、cot、sec、csc;

    角度值三角函数:sind、cosd、tand、cotd、secd、cscd;

    弧度制反三角:asin、acos、atan、acot、asec、acsc;

    角度值反三角:asind、acosd、atand、acotd、asecd、acscd;

    双曲函数:sinh、cosh、tanh、coth、sech、csch;

    反双曲:asinh、aosh、atanh、acoth、asech、acsch。

     

    例:

    >> sin([pi/6,pi/3,pi/2;0,3*pi/4,pi])
    
    ans =
    
        0.5000    0.8660    1.0000
             0    0.7071    0.0000
    

     

    指数类型

    exp:以自然对数底e为底数的指数函数y=

    log:自然对数;

    log10:以10为底的常用对数;

    log2:以2为底的对数;

    sqrt:算数平方根;

    nthroot(A,k):返回数值数组A的k次方实数根

     

    复数类型

    常用的负数类型的基本数学函数:

    abs 实数的绝对值或复数的模

    angle 弧度制的负数幅角主值;

    conj 负数共轭;

    i和j 虚数单位根号-1;

    real 复数实部;

    imag 复数虚部;

     

    舍入类型

    常用的舍入类型的基本数学函数:

    round 四舍五入成最靠近的整数

    fix:截去小数部分变成证书;

    floor:下取整(小于或等于x的最大整数)

    ceil:上取整(大于或等于x的最小整数)

    >> round([-3.46,-2.54,2.56,3.42])            //四舍五入
    
    ans =
    
        -3    -3     3     3
    
    
    
    
    >> fix([-3.46,-2.54,2.56,3.42])          //去掉小数部分
    
    ans =
    
        -3    -2     2     3
    
    
    >> floor([-3.46,-2.54,2.56,3.42])        //小于等于该数的第一个数
    
    ans =
    
        -4    -3     2     3
    
    >>ceil([-3.46,-2.54,2.56,3.42])            //大于等于该数的第一个数
    
    
    ans =
    
        -3    -2     3     4
    

    余数和质因数类型

    常用的余数和质因数类型的基本数学函数:

    mod:数论的模除运算;

    rem:除法的余数;

    factor:质因数分解;

    gcd:最大公约数;

    lcm:最小公倍数;

     

     

     

    多项式函数

     

    展开全文
  • matlab train函数

    万次阅读 2018-05-29 13:12:55
    network/train train Train a neural network. [NET,TR] = train(NET,X,T) takes a network NET, input data X and target data T and returns the network after training it, and a a training record ...
    network/train
     train Train a neural network.
     
       [NET,TR] = train(NET,X,T) takes a network NET, input data X
       and target data T and returns the network after training it, and a
       a training record TR.
     
       [NET,TR] = train(NET,X) takes only input data, in cases where
       the network's training function is unsupervised (i.e. does not require
       target data).
     
       [NET,TR] = train(NET,X,T,Xi,Ai,EW) takes additional optional
       arguments suitable for training dynamic networks and training with
       error weights.  Xi and Ai are the initial input and layer delays states
       respectively and EW defines error weights used to indicate
       the relative importance of each target value.
     
       train calls the network training function NET.trainFcn with the
       parameters NET.trainParam to perform training.  Training functions
       may also be called directly.
     
       train arguments can have two formats: matrices, for static
       problems and networks with single inputs and outputs, and cell arrays
       for multiple timesteps and networks with multiple inputs and outputs.
     
       The matrix format is as follows:
         X  - RxQ matrix
         Y  - UxQ matrix.
       Where:
         Q  = number of samples
         R  = number of elements in the network's input
         U  = number of elements in the network's output
     
       The cell array format is most general:
         X  - NixTS cell array, each element X{i,ts} is an RixQ matrix.
         Xi - NixID cell array, each element Xi{i,k} is an RixQ matrix.
         Ai - NlxLD cell array, each element Ai{i,k} is an SixQ matrix.
         Y  - NOxTS cell array, each element Y{i,ts} is a UixQ matrix.
         Xf - NixID cell array, each element Xf{i,k} is an RixQ matrix.
         Af - NlxLD cell array, each element Af{i,k} is an SixQ matrix.
       Where:
         TS = number of time steps
         Ni = NET.numInputs
         Nl = NET.numLayers,
         No = NET.numOutputs
         ID = NET.numInputDelays
         LD = NET.numLayerDelays
         Ri = NET.inputs{i}.size
         Si = NET.layers{i}.size
         Ui = NET.outputs{i}.size
     
       The error weights EW can be 1, indicating all targets are equally
       important.  It can also be either a 1xQ vector defining relative sample
       importances, a 1xTS cell array of scalar values defining relative
       timestep importances, an Nox1 cell array of scalar values defining
       relative network output importances, or in general an NoxTS cell array
       of NixQ matrices (the same size as T) defining every target element's
       relative importance.
     
       The training record TR is a structure whose fields depend on the network
       training function (net.NET.trainFcn). It may include fields such as:
         *  Training, data division, and performance functions and parameters
         * Data division indices for training, validation and test sets
         * Data division masks for training validation and test sets
         * Number of epochs (num_epochs) and the best epoch (best_epoch).
         * A list of training state names (states).
         * Fields for each state name recording its value throughout training
         * Performances of the best network (best_perf, best_vperf, best_tperf)
     
       Here a static feedforward network is created, trained on some data, then
       simulated using SIM and network notation.
     
         [x,t] = simplefit_dataset;
         net = feedforwardnet(10);
         net = train(net,x,t);
         y1 = sim(net,x)
         y2 = net(x)
     
       Here a dynamic NARX network is created, trained, and simulated on
       time series data.
     
        [X,T] = simplenarx_dataset;
        net = narxnet(1:2,1:2,10);
        view(net)
        [Xs,Xi,Ai,Ts] = preparets(net,X,{},T);
        net = train(net,Xs,Ts,Xi,Ai);
        Y = net(Xs,Xi,Ai)
     
       <strong>Training with Parallel Computing</strong>
     
       Parallel Computing Toolbox allows Neural Network Toolbox to train
       networks faster and on larger datasets than can fit on one PC.
     
       (Parallel and GPU training are currently supported for backpropagation
       training only, i.e. not Self-Organizing Maps.
     
       Here training automatically happens across MATLAB parallel workers.
     
         parpool
         [X,T] = vinyl_dataset;
         net = feedforwardnet(140,'trainscg');
         net = train(net,X,T,'UseParallel','yes');
         Y = net(X,'UseParallel','yes');
     
       Use Composite values to distribute the data manually, and get back
       the results as a Composite value.  If the data is loaded as it is
       distributed then while each piece of the dataset must fit in RAM, the
       entire dataset is only limited by the number of workers RAM.  Use
       the function configure to prepare a network for training
       with parallel data.
     
         net = feedforwardnet(140,'trainscg');
         net = configure(net,X,T);
         Xc = Composite;
         Tc = Composite;
         for i=1:numel(Xc)
           Xc{i} = X+rand(size(X))*0.1; % (Use real data instead
           Tc{i} = T+rand(size(T))*0.1; % instead of random data)
         end
         net = train(net,Xc,Tc);
         Yc = net(Xc);
         Y = cat(2,Yc{:});
     
       Networks can be trained using the current GPU device, if it is
       supported by the Parallel Computing Toolbox. This is efficient for
       large static problems or dynamic problems with many series.
     
         net = feedforwardnet(140,'trainscg');
         net = train(net,X,T,'UseGPU','yes');
         Y = net(X,'UseGPU','yes');
     
       If a network is static (no delays) and has a single input and output,
       then training can be done with data already converted to gpuArray form,
       if the network is configured with MATLAB data first.
     
         net = feedforwardnet(140,'trainscg');
         net = configure(net,X,T);
         Xgpu = gpuArray(X);
         Tgpu = gpuArray(T);
         net = train(net,Xgpu,Tgpu);
         Ygpu = net(Xgpu);
         Y = gather(Ygpu);
     
       To run in parallel, with workers associated with unique GPUs taking
       advantage of that hardware, while the rest of the workers use CPUs:
     
         net = feedforwardnet(140,'trainscg');
         net = train(net,X,T,'UseParallel','yes','UseGPU','yes');
         Y = net(X,'UseParallel','yes','UseGPU','yes');
     
       Only using workers with unique GPUs may result in higher speed, as CPU
       workers may not keep up.
     
         net = feedforwardnet(140,'trainscg');
         net = train(net,X,T,'UseParallel','yes','UseGPU','only');
         Y = net(X,'UseParallel','yes','UseGPU','only');
     
       Use the 'ShowResources' option to verify the computing resources used.
     
         net = train(...,'ShowResources','yes');
     
       <strong>Training Safely with Checkpoint Files</strong>
     
       The optional parameter CheckpointFile allows you to specify a file to periodically save
       intermediate values of the neural network and training record during training.  This protects
       training results from power failures, computer lock ups, Ctrl-C, or any other event that
       halts the training process before train returns normally.
     
       CheckpointFile can be set to the empty string to disable checkpoint saves (the default value),
       to a filename to save to the current working directory, or a file path.
     
       The optional parameter CheckpointDelay limits how often saves happen.  It has a default
       value of 60 which means that checkpoint saves will not happen more than once a minute.
       Limiting the frequency of checkpoints keeps the amount of time saving checkpoints low
       compared to the time spent in calculations, using time efficiently.  Set CheckpointDelay
       to 0 if you want checkpoint saves to occur every epoch.
     
       For example, here a network is trained with checkpoints saved at a rate no greater than
       once each two minutes.
     
         [x,t] = vinyl_dataset;
         net = fitnet([60 30]);
         net = train(net,x,t,'CheckpointFile','MyCheckpoint','CheckpointDelay',120);
     
       A computer failure happens, the latest network can be recovered and used to continue
       training from the point of failure. The checkpoint file includes a structure variable
       'checkpoint' which includes the network, training record, filename, time and number.
     
         [x,t] = vinyl_dataset;
         load MyCheckpoint
         net = checkpoint.net;
         net = train(net,x,t,'CheckpointFile','MyCheckpoint');
     
       Another use for this feature is to be able to stop a parallel training session (using the
       UseParallel parameter described above) even though the Neural Network Training Tool
       is not available during parallel training.  Set a CheckpointFile, use Ctrl-C to stop
       training any time, then load your checkpoint file to get the network and training record.
    展开全文
  • I was recently looking at the imagesc function on:What I want to do is take a square matrix of anything, doesn't matter what, integers, characters etc. and produce an image of it so that I can draw o....
  • 一种是用sind、cosd、tand等,他们是角度为单位的 另一种就是用deg2rad将角度转换为弧度。 下面是例子,四个式子的值是一样的。 sin(pi/6) sind(30) sin(deg2rad(30)) sind(rad2deg(pi/6)) ...
  • 还是一样,先贴程序%sampling and quantisationclc;clear;%samplingA = 1; % sinusoid's amplitudef = 2;% frequency Hzphase = 0*pi;% phase Radf_sample = 1000;%sample frequecyt_start = 0;t_stop = 1;t = t_...
  • Canadian East Coast radar trials and the K-distribution 这是T.J. Nohara和S. Haykin于1991年发表在《IEE Proceedings F - Radar and Signal Processing》上的文章,文章地址。以下是我对这篇文章的一个学习过程...
  • Matlab中的rectpuls函数解析

    千次阅读 2020-05-17 15:13:47
    This MATLAB function returns a continuous, aperiodic, unity-height rectangular pulse at the sample times indicated in array t, centered about t=0 and with a default width of 1. y = rectpuls(t) y =...
  • MATLAB中的三角函数单位问题

    千次阅读 2019-02-15 16:36:55
    今天看到atand这种matlab中的表达方式,...一种是用sind、cosd、tand、atand等,他们是角度为单位的 另一种就是用deg2rad将角度转换为弧度,同理rad2deg将弧度转换为角度,例如: 下面四个式子的值是一样的。 sin(pi...
  • t-检验:t-检验,又称student‘s t-...matlab中提供了两种相同形式的方法来解决这一假设检验问题,分别为ttest方法和ttest2方法,两者的参数、返回值类型均相同,不同之处在于ttest方法做的是One-sample and paired...
  • Matlab 三角函数输入

    千次阅读 2012-04-25 09:10:30
    tan(用弧度表示的角) tand(用度表示的角)   示例   >> a=tan(pi/4)  b=tand(45) a =  1.0000 b =  1.0000
  • Matlab中的mahal函数 马氏距离的相关介绍 Python自定义函数 def mathal(Y,X): mean = X.mean(axis=0) # Calculate mean of X cova = np.linalg.inv(np.cov(X.T)) # Calculate covariance of X delta=Y-mean # ...
  • 新版Matlab中神经网络训练函数Newff的详细讲解-新版Matlab中神经网络训练函数Newff的使用方法.doc 本帖最后由 小小2008鸟 于 2013-1-15 21:42 编辑 新版Matlab中神经网络训练函数Newff的详细讲解 一、 ...
  • 采用sind()、cosd()、tand()函数,这三个函数matlab程序中已经设计好的函数,可以直接采用,在括号中值解输入角度值即可;b.采用deg2rad()函数,将你输入的度数值转化为弧度值,这个函数也是matlab中已经预设计好...
  • MATLAB 进行模板匹配函数

    万次阅读 2009-11-04 20:58:00
    function [I_SSD,I_NCC]=template_matching(T,I)% TEMPLATE_MATCHING is a cpu efficient function which calculates matching % score images between template and an (color) 2D or 3D image.% It calculates:%
  • 使用M-文件编写S-函数,实现正余弦波的叠加。 编写m文件:sinAddcos.m function[sys, x0, str, ts] = sinAddcos(t,x,u,flag) %% Create a s function to add the sine wave and cosine wave % t --simulated time...
  • How can I calculate distance between two world map coordinates (latitude and longitude) using MATLAB R2015a (in meters)?解决方案If you don't have access to the MATLAB Mapping toolbox then a simple ...
  • matlab中sin(90)为什么不等于1运行sin(90),结果等于0.8940,为什么不等于1?sin(x)里的x不是指角度吗? x是弧度,不是角度,楼主看看sin(pi/2)可以看到 如果想用角度值,则用sind函数。...另外还有cosd,tand
  • matlab 中“newff” 函数的参数设置

    千次阅读 2017-08-03 10:30:00
    matlab 中“newff” 函数的使用方法技巧|和各参数的意义 ...% Here input P and targets T define a simple function which % we can plot: p = [0 1 2 3 4 5 6 7 8]; t = [0 0.84 0.91 0.14 -0.77 -0...
  • In this code, the invoke-static no longer affects the return value of the method and let's assume it doesn't do anything weird like write bytes to the file system or a network socket so it has no side...
  • matlab ezplot3 绘制三维函数

    千次阅读 2017-03-14 10:55:43
    描述 1、ezplot3(x,y,z) :在默认区间0 2、ezplot3(x,y,z,[tmin,tmax])...x(t), y = y(t), and z = z(t) 3、ezplot3(...,'animate'):  产生一个空间曲线的动态轨迹 4、ezplot3(axes_handle,...) : plots into th
  • 调用 Python 函数使文本在段落内换行MATLAB 具有 Python 标准库的大量等效功能,但并非全部。例如,textwrap 是一个模块,它可使用回车和其他便捷方式格式化文本块...T = 'MATLAB(R) is a high-level language and ...
  • invalid a and b'); end syms x y eq1 = (x-x1)^2+(y-y1)^2-a^2; eq2 = (x-x2)^2+(y-y2)^2-b^2; [x,y] = solve(eq1,eq2,x,y); x = double(x); y = double(y); [xs,ind]=max(x);...
  • 调用 Python 函数使文本在段落内换行MATLAB 具有 Python 标准库的大量等效功能,但并非全部。例如,textwrap 是一个模块,它可使用回车和其他便捷方式格式化文本块...T = 'MATLAB(R) is a high-level language and ...
  • matlab 角度 弧度

    千次阅读 2019-08-14 10:34:29
    matlab中sind、cosd、tand以角度为单位,sin、cos、tan函数等都是以弧度为单位 ...
  • 调用 Python 函数使文本在段落内换行MATLAB 具有 Python 标准库的大量等效功能,但并非全部。例如,textwrap 是一个模块,它可使用回车和其他便捷方式格式化文本块...T = 'MATLAB(R) is a high-level language and ...

空空如也

空空如也

1 2 3 4
收藏数 66
精华内容 26
关键字:

matlabtand函数

matlab 订阅