| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 12540 人关注过本帖
标题:MATLAB新手快来 新手问题交流帖
只看楼主 加入收藏
夜幽书生
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2007-5-11
收藏
得分:0 
各位高手:
  dx/dt=-0.15*y(t)
dy/dt=-0.1x(t)
x(0)=10000;y(0)=5000
这个微分方程用MATLAB怎样求解啊!

2007-05-12 10:45
lukaifengdd
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-4-13
收藏
得分:0 
请教
系统提示:
??? Error using ==> mpower
Matrix must be square.
那我问题到底是出在哪儿啊?
2007-05-12 16:26
wenzi1120
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-5-13
收藏
得分:0 

有谁能够写出PCL-818数据采集卡的采集数据(温度)的原代码.
我急需!!!!

2007-05-13 17:24
果肉
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-5-15
收藏
得分:0 
问个比较简单的问题
∫t|e(t) |dt
现需要用MATLAB 实现上面方程的求解.
积分上下限为0~无穷

我现在编了
syms s a b c
x=ilaplace((s+c)/(s+a)/(s+b));
x=simplify(x)

请问后面要怎么遍?

导师说 其实e(t)就等于C(T)-1
C(T)就是传递函数C(S)的拉是逆变换
按照老师的意思我编了上述程序
后面怎么遍下去就不知道了
请高手指教

[此贴子已经被作者于2007-5-15 0:45:50编辑过]

2007-05-15 00:24
para
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-5-20
收藏
得分:0 

程序编出来了,调试怎么也过不了,希望哪位大虾帮忙调试一下!
u,v,ed,E矩阵需要预定义吗?怎么预定义?


tic;
clear;clc;
epsilon=8.9e-12; num=21; a=0.2/(num-1); t=(num+1)/2;cons=300;
dp1=0.1;pg=1.025;ki=2.2e-4;
v(t,t)=6e4;v1=u;N=0;
while max(max(abs(v-v1)))>cons;
N=N+1;
v1=v;
for i=2:num-1
for j=2:num-1
Eox=-(v(i-1,j)-v(i+1,j))/(2*a);
Eoy=-(v(i,j-1)-v(i,j+1))/(2*a);
E(i,j)=sqrt(Eox.^2+Eoy.^2);
u(i,j)=0.25*(v(i,j-1)+v(i,j+1)+v(i-1,j)+v(i+1,j)+a^2*ed(i,j)/epsilon);
ed(i,j)=-epsilon/(2*a)*(Eox+Eoy)-0.5*((epsilon/a*(Eox+Eoy))^2
+4*(epsilon/a*(Eox*ed(i+1,j)+Eoy*ed(i,j+1))))^0.5;
u(1,:)=0;u(num,:)=0;u(:,num)=0;u(t,t)=6e4;ed(t,t)=3e-5;
end;
end;
v=u;
end;
d=[0:0.2/(num-1):0.2];
[x,y]=meshgrid(d);
u=abs(u);ed=abs(ed);E=abs(E);
figure(1);surfl(x,y,abs(u));
figure(2);surfl(x,y,abs(ed));
figure(3);surfl(x,y,abs(E));
toc

[此贴子已经被作者于2007-5-20 15:57:07编辑过]

2007-05-20 10:45
app21701appp
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2007-5-6
收藏
得分:0 
clear all
fid=fopen('E:ASA_IMS_1PNPDE20040107_061300_000000162023_00120_09693_0012.dat','r')
sta=fseek(fid,1100*1100,-1 )
Array=fread(fid,10*10,'uint8')
上面的3,4行语句出错,能告诉我为什么吗?
谢谢了。我刚学MATLAB。
FSEEK函数倒底怎么用?
2007-05-20 14:42
<紫翼>晓yue
该用户已被删除
收藏
得分:0 
提示: 作者被禁止或删除 内容自动屏蔽
2007-05-27 16:08
dmxl1984
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-5-12
收藏
得分:0 

我是一个新人,不怎么会编程,下面这个程序的错误在什么地方,帮忙看下
p(1)=0;
for t=2:512
p(t)=0.99*p(t-1)+sin^2*(800*t);
end
plot(p(t))
运行后提示是
??? Error using ==> sin
Not enough input arguments.

Error in ==> sin at 14
[varargout{1:nargout}] = builtin('sin', varargin{:});

Error in ==> l at 3
p(t)=0.99*p(t-1)+sin^2*(800*t);

2007-05-31 15:17
qinyanfeng00
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-5-31
收藏
得分:0 
以下是引用woshiheshibo在2006-11-26 13:15:54的发言:

你好,能解释一下以下gui个部分的功能吗


function varargout = eggui3(varargin)
% EGGUI3 M-file for eggui3.fig
% EGGUI3, by itself, creates a new EGGUI3 or raises the existing
% singleton*.
%
% H = EGGUI3 returns the handle to a new EGGUI3 or the handle to
% the existing singleton*.
%
% EGGUI3('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in EGGUI3.M with the given input arguments.
%
% EGGUI3('Property','Value',...) creates a new EGGUI3 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before eggui3_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to eggui3_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help eggui3

% Last Modified by GUIDE v2.5 25-Oct-2006 20:33:17

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @eggui3_OpeningFcn, ...
'gui_OutputFcn', @eggui3_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before eggui3 is made visible.
function eggui3_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to eggui3 (see VARARGIN)

% Choose default command line output for eggui3
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes eggui3 wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = eggui3_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes during object creation, after setting all properties.
function figure1_CreateFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

function zeta_edit_Callback(hObject, eventdata, handles)
% hObject handle to zeta_edit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of zeta_edit as text
% str2double(get(hObject,'String')) returns contents of zeta_edit as a double
z=str2num(get(handles.zeta_edit,'string'));
t=0:0.1:15;
cla;
%plot(t,sin(t));
for k=1:length(z)
y(:,k)=step(1,[2*z(k),1],t);
line(t,y(:,k));
end

% --- Executes during object creation, after setting all properties.
function zeta_edit_CreateFcn(hObject, eventdata, handles)
% hObject handle to zeta_edit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in gridon_push.
function gridon_push_Callback(hObject, eventdata, handles)
% hObject handle to gridon_push (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
grid on;

% --- Executes on button press in gridoff_push.
function gridoff_push_Callback(hObject, eventdata, handles)
% hObject handle to gridoff_push (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
grid off;

% --------------------------------------------------------------------
function option_Callback(hObject, eventdata, handles)
% hObject handle to option (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function Box_on_Callback(hObject, eventdata, handles)
% hObject handle to Box_on (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function Untitled_2_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
box on;

% --------------------------------------------------------------------
function Box_off_Callback(hObject, eventdata, handles)
% hObject handle to Box_off (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
box off;

那些前面 % 的注释部分不要理会,没 % 的是你设计的GUI图形设计中控件的函数标题,在一个模块下,如:
% --------------------------------------------------------------------
function Box_off_Callback(hObject, eventdata, handles)
% hObject handle to Box_off (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
box off;
你可以编程 来实现这个控件的功能。
所有的控件都能实现的话,就可以组成一个GUI界面,就象VFP做的那样一个界面。
上学期,我们做DSP课设的时候就是我就是用这个GUI设计一个高、低、带通滤波器的界面,效果还不错。
2007-05-31 20:23
zz06003232
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-5-31
收藏
得分:0 

各位高手.小弟我是新手入门了.想请教下.
如果我在matlab 编程中需要读取一些数据,,我要的只是数据,而不要用到前面的文件头啊..所以想在编程的时候在读取数据的时候把这些自动去掉...该怎么做啊~~(像这样的数据不只是一个..而是有很多个,所以手动删取是不可以的)这些数据是是如下:

#[FileName]
#FileName=D:\data\ww\0527\bk_40000.arc_data
#Map FileName=D:\data\zgp\526\2-2.arc_map
#Map Area Number=1
#TimeStamp=05-5-27 15:33:13
#[CCD]
#Interface=PCI Timer Card
#Controller=ST133
#CCDHead=HAMAMATSU 128 x 1024
#Mono_1_Present=true
#Mono_2_Present=false
#FilterWheel_1_Present=false
#FilterWheel_2_Present=false
#[CCD_Acquisition]
#TimeTaken=05-5-27 15:32:58
#DataCalc=ch1
#WaveUnits=nm
#Cycles=1
#DataSource=Area_Map_Profile
#IntegrationTime=40000
#HeadTemp=-34.5
#TempLocked=0
#AtoD=slow
#[CCD_Strips]
#Number_of_Strips=1
#[CCD_Strip_1]
#Startx=1
#Endx=1024
#Starty=1
#Endy=128
#[CCD_Mono3080650]
#Model=SP-308
#Serial=3080650
#WaveLength=5400000
#Grating=2
#Grating_Density=1200
#Grating_Blaze= 500 nm
#Entry=side
#EntryWidth=10
#Exit=front
#ExitWidth=0

# X Y
510.5755008 2842
510.6316334 2895
510.6877639 3008
510.743892 3035
510.800018 3030
510.8561416 3055
510.912263 3230
510.9683822 3211
511.024499 3273
511.0806137 3266
511.136726 3388
511.1928361 3307
511.248944 3328
511.3050495 3473
511.3611528 3411
511.4172539 3418
511.4733526 3396
511.5294491 3376

2007-05-31 20:59
快速回复:MATLAB新手快来 新手问题交流帖
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.041377 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved