1. matlab中gradient函数求f=2x2+3y3的梯度的实例
#
http://www.zdh1909.com/html/matlab/9930.html
matlab中gradient函数求f=2x2+3y3的梯度的实例如下:
在上MATLAB课的时候,有学生问怎么用gradient函数求f=2x2+3y3的梯度啊,不懂得怎么写格式,试了很多次都不行.解答如下:
在MATALB中,求梯度只能是求数值梯度,所以必须将函数f离散化,用差分代替微分,精度取决于差分步长,因为现在计算机速度足够快,所以差分可以取得足够小,也不影响计算速度和计算精度.方法如下:
>>X=-6:0.6:6; %计算区间是[-6 6],步长0.6
>>Y=X;
>>[x,y]=meshgrid(X,Y) %生成计算网格
>>f=2.*x.^2+3.*y.^3 %计算网格结点上的函数值
>>[Dx,Dy]=gradient(f) %用数值方法求函数梯度
>>quiver(X,Y,Dx,Dy) %用矢量绘图函数绘出梯度矢量大小分布
>>hold on
>>contour(X,Y,f) %与梯度值对应,绘出原函数的等值线图
2. Using errorbar() with semilogy() in MATLAB?
#
http://stackoverflow.com/questions/3550241/using-errorbar-with-semilogy-in-matlab
h = errorbar(x,y,ebar); set(get(h,'Parent'), 'XScale', 'log') `</pre>
or
<pre>`ax = axes(); errorbar(ax, x,y,ebar); set(ax, 'XScale', 'log');
3. Multi y axis
#
[http://stackoverflow.com/questions/6573862/matlab-two-y-axis-with-the-same-x-axis](http://stackoverflow.com/questions/6573862/matlab-two-y-axis-with-the-same-x-axis)
1. 计算机领域学习路线图
#
from: http://goo.gl/RZtPC
![http://ocw.mit.edu/images/logo-ocw-home_new.gif](http://ocw.mit.edu/images/logo-ocw-home_new.gif)
目标
#
帮助计算机领域的初学者, 从零开始, 一步步成为一个靠谱的计算机领域的专家. 这里面只包含偏软件的部分.
我们需要达成以下目标:
- 了解计算机领域的基础知识. 对背景的了解是基础.
- 拥有计算机科学家的思维和解决问题的能力
- 能编程! 编程是我们解决问题的主要方式.
- 使用开源系统, 加入到开源社区中去
计算机基础课程学习
#
想要学习计算机领域的基础知识, 我选择使用mit公开课里面的内容. 下面我挑了一些必读课程:
入门课程.
可做和必做事项
#
下面我整理了一些必须做和可做的事情, 我觉得它们对于提高实力非常重要.
开源社区
-
安装和使用linux, 在linux上面做开发
...
skills:
#
shortcut of “echo”: <?=$foo?>
phpMyadmin timeout / maxlifttime / cookie validity:
#
ref:http://birdchan.com/home/2011/06/06/phpmyadmin-timeout-after-1440-seconds/
vim /etc/phpmyadmin/config.inc.php : add:
$cfg[‘Servers’][$i][‘LoginCookieValidity’] = 60 * 60 * 4; //4 hours
vim /etc/php5/cli/php.ini : modify:
session.gc_maxlifetime = 14400
Add / Create a User:
#
CREATE USER <userName>@localhost IDENTIFIED BY "<newPassWd>"; CREATE DATABASE <newDbName> DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL ON <newDbName>.* TO <userName>@localhost;
Super PRIVILEGES:
GRANT ALL <span style="text-decoration: underline;">PRIVILEGES</span> ON *.* TO <userName>@localhost WITH GRANT OPTION;
Revoke:
REVOKE INSERT ON *.* FROM <userName>@localhost; REVOKE ALL PRIVILEGES, GRANT OPTION FROM <userName>@localhost;
Reset the password:
#
SET PASSWORD FOR <userName>@localhost = PASSWORD('<newPassWd>');
reset root password: http://goo.gl/jGXR6
...
see also tcpdump
Install Wireshark
#
sudo add-apt-repository ppa:wireshark-dev/stable
sudo apt update
sudo apt install wireshark
Config For Non-Root (Normal) Users
#
for 1 user
#
chgrp ats /usr/bin/dumpcap
chmod 4750 /usr/bin/dumpcap # chmod u+s
for a user group
#
groupadd wireshark
usermod -a -G wireshark userName1
chgrp wireshark /usr/bin/dumpcap
chmod 4750 /usr/bin/dumpcap
ref:
http://anonscm.debian.org/viewvc/collab-maint/ext-maint/wireshark/trunk/debian/README.Debian?view=markup
Update: 2017-01-06
Warn 1: for non-English, use samba/sshfs instead. unless win has NFS v4 or above which can solve non-UTF8 problems.
Warn 2: svchost
consumes 1.5GB ram, don’t know why.
See Also Links
SSHFS/SFTP
CIFS/SMB/Samba
OBS
#
Combining simlink (ln -s
) with NFS may cause weird file path problems. We tried to have a link at NFS to Dropbox in nfs, also tried to have a link at home to mount point at /mnt. Both caused some minor path and file issues, but no series problems.
...
See also: /iptables
FreeBsd 7 Local Router (Like a Switch ???)
#
(local only, no NAT)
vim /etc/rc.conf
ifconfig_em0="inet 10.0.0.12 netmask 255.255.255.0"
ifconfig_em1="inet 10.0.1.13 netmask 255.255.255.0"
notice: will get route problem if using the same net-addr.
# vim /etc/sysctl.conf
net.inet.ip.forwarding=1
# reboot
sysctl net.inet.ip.forwarding=1
# or
echo 1 > /proc/sys/net/ipv4/ip_forward
// problem: ping test: could get reply since icmp packet 113. where are the first 112 packets???
FreeBsd 7 Bridge
#
ref: shaper freeBsd-v7 : bridge
...
-
vmware
-
Linux ubuntu 2.6.32-38-generic #83-Ubuntu SMP Wed Jan 4 11:13:04 UTC 2012 i686 GNU/Linux
-
DISTRIB_ID=Ubuntu; DISTRIB_RELEASE=10.04; DISTRIB_DESCRIPTION=“Ubuntu 10.04.4 LTS”
-
httpd-2.0.64.tar.bz2; net-snmp-5.4.4; mod_ap2_snmp_1.04.
-
sudo -s;
-
apt-get remove lamp-server^ snmpd # if you have already installed apache or snmp-server.
Just do it:
#
http://mod-apache-snmp.sourceforge.net/english/docs.htm
(below is a summary)
1) Install Apache Web Server with DSO support enabled.
./configure --enable-so; make; make install
2) Unzip NET-SNMP sources.
...
The path "" is not valid path to the gcc binary. Would you like to change it? [yes]
when typed in "/usr/bin/gcc" manually,
The path "/usr/bin/gcc" is not valid path to the gcc binary. Would you like to change it? [yes]
I found solution:
http://superuser.com/questions/192047/gcc-path-not-valid-when-installing-vmware-tools-from-vmware-workstation-7-1-1-bu
ie: sudo apt-get install linux-source linux-headers-
uname -r
libglib2.0-0
// Got “If you wish to have the shared folders feature, you can install the driver by running vmware-config-tools.pl again after making sure that gcc, binutils, make and the kernel sources for your running kernel are installed” before install “linux-source”.
...
XX的kde, 你以为你是微软啊, 乱给用户装东西!!!
卸载了半天, 一直找不到该卸载什么,最后只好这么办:
apt-get install kwalletmanager
运行 kwalletmanager, 设置里面 uncheck “enable kwallet subsys”.