Search Results

Search found 1051 results on 43 pages for 'matlab'.

Page 22/43 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • How to convert a C++ program that uses CUDA into MEX

    - by Harold Wellington Graves
    For work, I am converting the Image Denoising program that comes with the CUDA SDK into a MATLAB program. As far as I know, I have made all the necessary changes required by MATLAB, but when I try to call mex on it, MATLAB returns a bunch of linkage errors that I have no idea how to fix. If anyone has any suggestions on what I might be doing wrong, I would greatly appreciate it. The command I am giving MATLAB is: mex imageDenoisingGL.cpp -I..\..\common\inc -IC:\CUDA\include -L..\..\common\lib -lglut32 And the output from MATLAB is a bunch of these: imageDenoisingGL.obj : error LNK2019: unresolved external symbol __imp__cutCheckCmdLineFlag@12 referenced in function "void __cdecl __cutilExit(int,char * *)" (?__cutilExit@@YAXHPAPAD@Z) I am running: Windows XP x32 Visual Studio 2005 MATLAB 2007a

    Read the article

  • How do you pass in a value to a subfunction in Matlab I am getting output errors?

    - by Ben Fossen
    Below is my code in Matlab I am having trouble with the line sum = (h/2) * (f(a) + f(b)) + h; Matlab says I have to many outputs when I try to call the f(x) function. Is my problem with the f(x) function function Trapezoid_Uniform(a,b,n) h = (b - a)/n; sum = (h/2) * (f(a) + f(b)) + h; for i = 1:n-1 x = a + i*h; sum = sum + f(x); end sum = sum*h; disp(sum); end function f(z) f = exp(z); end

    Read the article

  • How do you write multiple lists from Matlab to the same excel file?

    - by Ben Fossen
    I have several lists in Matlab that I want to write to the same excel file. I have one list xordered and another list aspl. I do not know the length of the lists till after I run the Matlab program. I used data = xlswrite('edgar.xls',fliplr(sortedx'),'A2:A3000') for the first list but when I tried to write another list to the same file like this I ended up with two different excel files named edgar.xls asp_data = xlswrite('edagr.xls', fliplr(aspl'), 'B2:B3000') Is there a way I can write both of these lists into the same excel file? xordered in the A column and aspl in the B column?

    Read the article

  • Realy urgent and big help in a little MATLAB game... Please help me!

    - by Sanyi
    Hi! I have to make the game „Planarity” in Matlab, for school project. (If you Google it, you can see and play the game in flash). The computer have to randomly put 5 circles in the coordinate system in different positions. After that it must draw lines between them. When the circles are randomly put in the coordinate system the coordinates must be whole numbers. Good example for number one circle: (3,4) ; bad example for number one circle (2.5 ,6.7). Please if Matlab is a childs game to you help me by sending me the source code for this. I really really need help... Please help me, this can be one hour to you, but a life saving thing to me...

    Read the article

  • can i changed for loop index variable inside the loop in Matlab???

    - by shawana
    hi every one. i need to change my loop variable inside the iterationa as ihave to acces array elements in the loop which is changing w.r.t size inside the loop. ashort piece of code is that: que=[]; que=[2,3,4]; global len; len=size(que,2) x=4; for i=1:len if x<=10 que(x)= 5; len=size(que,2) x=x+1; end end que array should print like: 2 3 4 5 5 5 5 5 5 5 but it is printed in such a way: 2 3 4 5 5 5. how shuould it be accomplished in matlab? in visual c++ it happen correctly and print whole array of 10 elements which increases at run time plz reply me if have any ideaabout this as i m new into matlab

    Read the article

  • Packaging MATLAB (or, more generally, a large binary, proprietary piece of software)

    - by nfirvine
    I'm trying to package MATLAB for internal distribution, but this could apply to any piece of software with the same architecture. In fact, I'm packaging multiple releases of MATLAB to be installed concurrently. Key things Very large installation size (~4 GB) Composed of a core, and several plugins (toolboxes) Initially, I created a single "source" package (matlab2011b) that builds several .debs (mainly matlab2011b-core and matlab2011b-toolbox-* for each toolbox). The control file is just the standard all: dh $@ There is no Makefile; only copying files. I use a number of debian/*.install files to specify files to copy from a copy of an installation to /usr/lib/. The problem is, every time I build the thing (say, to make a correction to the core package), it recopies every file listed in the *.install file to e.g debian/$packagename/usr/ (the build phase), and then has to bundle that into a .deb file. It takes a long time, on the order of hours, and is doing a lot of extra work. So my questions are: Can you make dh_install do a hardlink copy (like cp -l) to save time? (AFAICT from the man page, no.) Maybe I should just get it to do this in the Makefile? (That's gonna b e big Makefile.) Can you make debuild only rebuild .debs that need rebuilding? Or specify which .debs to rebuild? Is my approach completely stupid? Should I break each of the toolboxes into its own source package too? (I'll have to do some silly templating or something, because there's hundreds of them. :/)

    Read the article

  • Trying to sort the coefficients of the polynomial (z-a)(z-b)(z-c)...(z-n) into a vector

    - by pajamas
    So I have a factored polynomial of the form (z-a)(z-b)(z-c)...(z-n) for n an even positive integer. Thus the coefficient of z^k for 0 <= k < n will be the sum of all distinct n-k element products taken from the set {a,b,...,n} multiplied by (-1)^k, I hope that makes sense, please ask if you need more clarification. I'm trying to put these coefficients into a row vector with the first column containing the constant coefficient (which would be abc...n) and the last column containing the coefficient for z^n (which would be 1). I imagine there is a way to brute force this with a ton of nested loops, but I'm hoping there is a more efficient way. This is being done in Matlab (which I'm not that familiar with) and I know Matlab has a ton of algorithms and functions, so maybe its got something I can use. Can anyone think of a way to do this? Example: (z-1)(z-2)(z-3) = z^3 - (1 + 2 + 3)z^2 + (1*2 + 1*3 + 2*3)z - 1*2*3 = z^3 - 6z^2 + 11z - 6. Note that this example is n=3 odd, but n=4 would have taken too long to do by hand. Edit: Let me know if you think this would be better posted at TCS or Math Stack Exchange.

    Read the article

  • Could not determine the size of this expression.

    - by Søren
    Hi, I have resently started to use MATLAB Simulink, and my problem is that i can't implement an AMDF function, because simulink compiler cannot determine the lengths. Simulink errors: |--------------------------------------------------------------------------------------- Could not determine the size of this expression. Function 'Embedded MATLAB Function2' (#38.728.741), line 33, column 32: "1:flength-k+1" Errors occurred during parsing of Embedded MATLAB function 'Embedded MATLAB Function2'(#38) Embedded MATLAB Interface Error: Errors occurred during parsing of Embedded MATLAB function 'Embedded MATLAB Function2'(#38) . |--------------------------------------------------------------------------------------- MY CODE: |--------------------------------------------------------------------------------------- persistent sLength persistent fLength persistent amdf % Length of the frame flength = length(frame); % Pitch period is between 2.5 ms and 19.5 ms for LPC-10 algorithm % This because this algorithm assumes the frequencyspan is 50 and 400 Hz pH = ceil((1/min(fspan))*fs); if(pH flength) pH = flength; end; pL = ceil((1/max(fspan))*fs); if(pL <= 0 || pL = flength) pL = 0; end; sLength = pH - pL; % Normalize the frame frame = frame/max(max(abs(frame))); % Allocating memory for the calculation of the amdf %amdf = zeros(1,sLength); %%%%%%%% amdf = 0; % Calculating the AMDF with unbiased normalizing for k = (pL+1):pH amdf(k-pL) = sum(abs(frame(1:flength-k+1) - frame(k:flength)))/(flength-k+1); end; % Output of the AMDF if(min(amdf) < lvlThr) voiced = 1; else voiced = 0; end; % Output of the minimum of the amdf minAMDF = min(amdf); |---------------------------------------------------------------------------------------- HELP Kind regards Søren

    Read the article

  • How would i down-sample a .wav file then reconstruct it using nyquist? - in MATLAB

    - by Andrew
    This is all done in MATLAB 2010 My objective is to show the results of: undersampling, nyquist rate/ oversampling First i need to downsample the .wav file to get an incomplete/ or impartial data stream that i can then reconstuct. Heres the flow chart of what im going to be doing So the flow is analog signal - sampling analog filter - ADC - resample down - resample up - DAC - reconstruction analog filter what needs to be achieved: F= Frequency F(Hz=1/s) E.x. 100Hz = 1000 (Cyc/sec) F(s)= 1/(2f) Example problem: 1000 hz = Highest frequency 1/2(1000hz) = 1/2000 = 5x10(-3) sec/cyc or a sampling rate of 5ms This is my first signal processing project using matlab. what i have so far. % Fs = frequency sampled (44100hz or the sampling frequency of a cd) [test,fs]=wavread('test.wav'); % loads the .wav file left=test(:,1); % Plot of the .wav signal time vs. strength time=(1/44100)*length(left); t=linspace(0,time,length(left)); plot(t,left) xlabel('time (sec)'); ylabel('relative signal strength') **%this is were i would need to sample it at the different frequecys (both above and below and at) nyquist frequency.*I think.*** soundsc(left,fs) % shows the resaultant audio file , which is the same as original ( only at or above nyquist frequency however) Can anyone tell me how to make it better, and how to do the sampling at verious frequencies?

    Read the article

  • Matlab GUI - How to get the previous value entered from a callback function?

    - by Graham
    Hi, I know that this is probably a simple problem but I am new to Matlab GUI's and basically want to get the old value which used to be stored in the text box to replace the value which has just been entered. E.g. Text box contains a valid string, User enters invalid string, Callback func, validates input and realises new input is an error and reverts to the old previous value. How should this be implemented or done? Atm I am just using the get and set property values. Below is some sample code: function sampledist_Callback(hObject, eventdata, handles) % hObject handle to sampledist (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 sampledist as text % str2double(get(hObject,'String')) returns contents of sampledist as a double input = str2double(get(hObject,'String')); if(input < 0 || input > 500) errordlg('Sampled Dist. must be > 0 and < 500','Sample Dist - Input Error'); set(handles.sampledist,'String',['10']); %<--- I would like this value 10 to be the previous entry! guidata(hObject,handles); else set(handles.sampledist,'String',['',input]); guidata(hObject,handles); end

    Read the article

  • « Pourquoi développer en MATLAB plutôt qu'en Java, Python ou C# ? », un séminaire gratuit de MathWorks le 13 décembre

    Pourquoi développer en MATLAB Plutôt qu'en Java, Python ou C# : un séminaire gratuit de MathWorks le 13 décembre MathWorks organise ce 13 décembre à La Défense un séminaire pour illustrer les atouts de MATLAB. « Lors de cette rencontre en matinée, vous découvrirez que MATLAB n'est pas simplement un langage de calcul scientifique mais un langage ouvert vous permettant de structurer vos développements d'applications d'entreprise », promet l'éditeur de MATLAB qui le compare aujourd'hui à Java, Python ou C#. La matinée illustrera l'utilisation d'interfaces externes (APIs) et la programmat...

    Read the article

  • Ubuntu 12.04 tilts when trying to open large excel file with libreoffice or matlab

    - by user1565754
    I have an xlsx-file of size 27.3MB and when I try to open it either in Libreoffice or Matlab the whole system slows down My processor is AMD Sempron(tm) 140 Processor (should be about 2.7Ghz) Memory I have about 1.7GB Any ideas? I opened this file in Windows no problem...of course it took a few seconds to load but Ubuntu freezes with this file completely...smaller files of size 3MB, 5MB etc open just fine... thnx for support =)

    Read the article

  • is there a faster version of fminbnd in matlab?

    - by kloop
    I am now using fminbnd in Matlab, and I find it relatively slow (I am using it inside a nested loop). The function itself, its interface and the values it returns are great, but when looking into the .m file I see it is not optimized. As a matter of fact, I was hoping for something like that to be written as a mex. Anyone knows of an alternative to fminbnd which works much faster and does not have much overhead?

    Read the article

  • difference equations in MATLAB - why the need to switch signs?

    - by jefflovejapan
    Perhaps this is more of a math question than a MATLAB one, not really sure. I'm using MATLAB to compute an economic model - the New Hybrid ISLM model - and there's a confusing step where the author switches the sign of the solution. First, the author declares symbolic variables and sets up a system of difference equations. Note that the suffixes "a" and "2t" both mean "time t+1", "2a" means "time t+2" and "t" means "time t": %% --------------------------[2] MODEL proc-----------------------------%% % Define endogenous vars ('a' denotes t+1 values) syms y2a pi2a ya pia va y2t pi2t yt pit vt ; % Monetary policy rule ia = q1*ya+q2*pia; % ia = q1*(ya-yt)+q2*pia; %%option speed limit policy % Model equations IS = rho*y2a+(1-rho)yt-sigma(ia-pi2a)-ya; AS = beta*pi2a+(1-beta)*pit+alpha*ya-pia+va; dum1 = ya-y2t; dum2 = pia-pi2t; MPs = phi*vt-va; optcon = [IS ; AS ; dum1 ; dum2; MPs]; He then computes the matrix A: %% ------------------ [3] Linearization proc ------------------------%% % Differentiation xx = [y2a pi2a ya pia va y2t pi2t yt pit vt] ; % define vars jopt = jacobian(optcon,xx); % Define Linear Coefficients coef = eval(jopt); B = [ -coef(:,1:5) ] ; C = [ coef(:,6:10) ] ; % B[c(t+1) l(t+1) k(t+1) z(t+1)] = C[c(t) l(t) k(t) z(t)] A = inv(C)*B ; %(Linearized reduced form ) As far as I understand, this A is the solution to the system. It's the matrix that turns time t+1 and t+2 variables into t and t+1 variables (it's a forward-looking model). My question is essentially why is it necessary to reverse the signs of all the partial derivatives in B in order to get this solution? I'm talking about this step: B = [ -coef(:,1:5) ] ; Reversing the sign here obviously reverses the sign of every component of A, but I don't have a clear understanding of why it's necessary. My apologies if the question is unclear or if this isn't the best place to ask.

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >