https://www.mathworks.com/matlabcentral/answers/questions.atomMATLAB Answers — New Questions2018-10-20T02:13:17Ztag:www.mathworks.com,2005:Question/4250382018-10-20T02:07:13Z2018-10-20T02:13:17ZHow to show function is converging towards a point or not.<p>Say F is function of n and x. Say F=(n*x)/1+(n*x)^2
Is given function then for x[0,k] where k belongs to (0,1). Show that when n tends to infinity will give converging function. Using graphs. Basically just take limit as n tends to infinity where x belongs accordingly.
Please I need code as I am getting few error.</p>Ujjwalhttps://www.mathworks.com/matlabcentral/profile/authors/7552308-ujjwaltag:www.mathworks.com,2005:Question/3972192018-04-25T07:17:56Z2018-10-20T02:09:43ZHow to find all possible routes with a given node matrix?<p>Hello,</p><p>I am trying to write a function to find all possible routes from the Start node, 6, to the Goal node, 21, with the given node matrix, A, as shown in the below.</p><p>A =</p><pre> 1 6
1 23
2 3
2 4
2 5
3 2
4 2
4 7
5 2
5 11
6 1
6 26
7 4
7 8
8 7
8 9
8 24
9 8
9 23
10 11
10 13
10 15
10 16
11 5
11 10
12 13
12 14
13 10
13 12
13 24
14 12
14 19
15 10
15 17
16 10
16 17
16 18
17 15
17 16
17 25
18 16
18 19
18 22
19 14
19 18
19 20
20 19
21 22
21 27
22 18
22 21
22 25
23 1
23 9
24 8
24 13
25 17
25 22
26 6
27 21</pre><img src = "/matlabcentral/answers/uploaded_files/114652/untitled.jpg"><p>I would like to build a function which results the following outputs.</p><p>[6,1,23,9,8,7,4,2,5,11,10,15,17,25,22,21]</p><p>[6,1,23,9,8,7,4,2,5,11,10,15,17,16,18,22,21]</p><p>[6,1,23,9,8,7,4,2,5,11,10,16,17,25,22,21]</p><p>[6,1,23,9,8,7,4,2,5,11,10,16,18,22,21]</p><p>[6,1,23,9,8,24,13,10,15,17,25,22,21]</p><p>[6,1,23,9,8,24,13,10,16,17,25,22,21]</p><p>[6,1,23,9,8,24,13,10,16,18,22,21]</p><p>[6,1,23,9,8,24,13,12,14,19,18,16,10,15,17,25,22,21]</p><p>[6,1,23,9,8,24,13,12,14,19,18,16,17,25,22,21]</p><p>[6,1,23,9,8,24,13,12,14,19,18,22,21]</p><p>Thank you very much for your invaluable time to help on this problem.</p><p>Best regards,</p><p>Sunghun Jung</p>Jung Sunghunhttps://www.mathworks.com/matlabcentral/profile/authors/7994431-jung-sunghuntag:www.mathworks.com,2005:Question/4242852018-10-16T12:36:17Z2018-10-20T02:06:06ZHow can i use the output of an arduino load in matlab<p>I have an Arduino uno in combination with an IMU (MPU-9250). I programmed this uno in Arduino with roll, pitch and yaw as output. In processing i could read this data easily.</p><p>Is it possible to load the live data (the roll pitch yaw and time values) into matlab? As end product I would like a graph with a function (sawtooth) what is depend on the movement of the imu.</p>ditte moejeshttps://www.mathworks.com/matlabcentral/profile/authors/3716036-ditte-moejestag:www.mathworks.com,2005:Question/4250372018-10-20T02:04:15Z2018-10-20T02:04:15ZHow to modify an array's elements using another element?<p>I need to write a for loop that will set each array element in bonusScore to the sum of itself and the next element (except for the last element which stays the same). Why why does my code yield these (incorrect) output numbers? What should I do to fix my code?</p><pre class="language-matlab">function bonusScores = CombineScores(numberScores, userScores)
for i = 1:numbersScores;
userScores(1) = userScores(1) .* 2 + userScores(2);
userScores(2) = userScores(2) .* 2 + userScores(3);
userScores(3) = userScores(3) .* 2 + userScores(4);
bonusScores = userScores;
end
end
</pre><p>Input: CombineScores(4, [10, 20, 30, 40])
Output: ans = 1800, 1960, 1080, 40</p>Matthew Burtonhttps://www.mathworks.com/matlabcentral/profile/authors/13183596-matthew-burtontag:www.mathworks.com,2005:Question/4250332018-10-20T00:26:04Z2018-10-20T01:52:23ZHow do I solve this error "Index exceeds matrix dimensions."<p>Hello,</p><p>I am having issues with a code I got via this link <a href = "https://www.mathworks.com/matlabcentral/fileexchange/38200-fast-non-local-mean-image-denoising-implementation">https://www.mathworks.com/matlabcentral/fileexchange/38200-fast-non-local-mean-image-denoising-implementation</a>.</p><p>Corrections where made on the codes via the comments but I still have errors when I made the suggested corrections and applied the code in my proposed algorithm. The error reads below:</p><pre class="language-matlab">Index exceeds matrix dimensions.
</pre><pre class="language-matlab">Error in FAST_NLM_II (line 54)
</pre><pre> SqDist =
Sd(PatchSizeHalf+WindowSizeHalf+1:Height+WindowSizeHalf+PatchSizeHalf,PatchSizeHalf+WindowSizeHalf+1:Width+WindowSizeHalf+PatchSizeHalf)...
% lower right corner</pre><p>I will appreciate contributions.</p><p>Thank you</p>Chidiebere Ikehttps://www.mathworks.com/matlabcentral/profile/authors/10712487-chidiebere-iketag:www.mathworks.com,2005:Question/4250362018-10-20T01:25:10Z2018-10-20T01:50:10ZCenter graph in figure window<p>Does anyone know how to center a graph in the figure window? As you can easily see...the top end of the y axis is touching the white frame containing the figure title...</p>Annalisa Scimemihttps://www.mathworks.com/matlabcentral/profile/authors/11291168-annalisa-scimemitag:www.mathworks.com,2005:Question/4250122018-10-19T20:38:04Z2018-10-20T01:48:19ZHow to rename files in subfolders within a folder<p>I have multiple files in subfolders within a main folder. I want to rename the files by inserting some text before the actual file name.</p><p>For example I have subfolders with different names 32_post, 43, 44 etc. and each subfolder has different files smooth_frame0.nii.gz, moved_frame.nii.gz and I want to rename these files as P32_post_smooth_frame0.nii.gz, and so on...</p>Deephttps://www.mathworks.com/matlabcentral/profile/authors/13665495-deeptag:www.mathworks.com,2005:Question/10582011-02-08T22:05:18Z2018-10-20T01:41:02ZContributors metainfo: reputation and more<p>As asked by <a href="http://www.mathworks.com/matlabcentral/answers/contributors/2710900-vieniava">Vieniava</a> in <a href="http://www.mathworks.com/matlabcentral/answers/1041-how-to-make-a-list-of-user-s-reputation">"How to make a list of user's reputation?"</a>, some of us came up with interesting ideas on how to fill an <i>updated list</i> with the reputation scores of the contributors to <b>Answers</b>.</p>
<p>I took the initiative to compile a public list of users with meta info:</p>
<ul>
<li>position (desc ordering by reputation)</li>
<li>id</li>
<li>nickname (truncated to fit the page)</li>
<li>reputation</li>
<li># of comments</li>
<li># of questions asked</li>
<li>% accept rate</li>
<li># of posts answered</li>
<li># of accepted answers</li>
</ul>
<p>The code used to compile the list is available at the bottom.</p>
<p><b>EDIT</b></p>
<p>TMW team implemented a page with the metascores: <a href="http://www.mathworks.com/matlabcentral/answers/contributors">http://www.mathworks.com/matlabcentral/answers/contributors</a></p>
<p>Please refer to it and congrats to the team!</p>
<p>Use this function to retrieve info from the link above:</p>
<pre class="language-matlab">function [metainfo, elapsedTime] = metainfo(type,order)
% METAINFO - Retrieve metainfo on contributors to www.matworks.com/.../answers
%
% METAINFO Retrieve data sorted by reputation in descending order
%
% METAINFO(TYPE,ORDER) Specify TYPE and sorting ORDER as
% type : 'reputation'
% 'questions'
% 'answered'
% 'accepted'
%
% order: 'asc'
% 'desc'
%
% Examples:
%
% % Standard call (rep, disc)
% info = metainfo;
%
% % Sort by question answered in descending order
% info = metainfo('an','d');
%
% See also: URLREAD, REGEXP
</pre>
<pre class="language-matlab">% Author: Oleg Komarov (oleg.komarov@hotmail.it)
% Tested on R14SP3 (7.1) and on R2009b. In-between compatibility is assumed.
% 28 feb 2011 - Created
</pre>
<pre class="language-matlab">tic
</pre>
<pre class="language-matlab">% Check # inputs
error(nargchk(0,2,nargin))
</pre>
<pre class="language-matlab">% Retrieve inputs
if nargin == 0
type = 'reputation';
order = 'desc';
end
if ~exist(type,'var')
sortTypes = {'reputation','questions','answered','accepted'};
type = sortTypes{strncmp(type,sortTypes,numel(type))};
order = 'desc';
end
if ~exist(order,'var')
orderTypes = {'asc','desc'};
type = orderTypes{strncmp(order,orderTypes,numel(order))};
end
</pre>
<pre class="language-matlab">% Build url string
url = ['http://www.mathworks.com/matlabcentral/answers/contributors?'...
'dir=' order '&sort=' type '&page='];
</pre>
<pre class="language-matlab">% First read
[page, ok] = urlread([url '1']);
</pre>
<pre class="language-matlab">% Catch number of pages to read
if ok
totcon = regexp(page,'>1 - 50 of (\d+)','tokens');
totcon = dataread('string',totcon{1}{1},'%d');
nPages = ceil(totcon/50);
else
error('Cannot read ".../contributors?page=1"')
end
</pre>
<pre class="language-matlab">% Loop over contributors pages
metainfo = cell(totcon,7);
metainfo(1:end,1) = num2cell(1:size(metainfo,1));
for p = 1:nPages
if ok
endpos = 50*p;
% Id, Rep
expr = '><a href="\/matlabcentral\/answers\/contributors\/(\d+)';
data = regexp(page, expr,'tokens');
if 50*p > totcon; endpos = 50*(p-1)+numel(data); end
metainfo(1+(p-1)*50:endpos,2) = [data{:}];
% Nickname
expr = ['"Reputation: (\d+)">([\w\ ' reshape([repmat(92,1,137);33:59,61:64,91:97,123:126,161:255],1,[]) ']+)</a></h2>'];
data = regexp(page, expr,'tokens');
metainfo(1+(p-1)*50:endpos,[4,3]) = cat(1,data{:});
% Qcount, Ans, Acc
data = regexp(page, '<span >(\d+)</span>[A-z<>"-\s\/]+','tokens');
metainfo(1+(p-1)*50:endpos,5:7) = reshape(cat(1,data{:}),3,[]).';
else
error('Metainfo import stopped. \nCannot read ".../contributors?page=%d"',p)
end
[page, ok] = urlread([url sprintf('%d',p+1)]);
end
</pre>
<pre class="language-matlab">% Convert to doubles
metainfo(:,[2,4:7]) = cellfun(@str2double,metainfo(:,[2,4:7]),'un',false);
</pre>
<pre class="language-matlab">elapsedTime = toc;
</pre>Oleg Komarovhttps://www.mathworks.com/matlabcentral/profile/authors/1886545-oleg-komarovtag:www.mathworks.com,2005:Question/4249632018-10-19T15:05:17Z2018-10-20T01:33:37Zhow to access variable from another function<p>I want to build two functions, the first one has basic equations, and the second one for channel modeling,
my question is how to access a variable from the first function in the second function?
because I want to assign values for the variables available in the first function, in the second function
for example I will try for different temperature values
can any one help?</p>Alice Faisalhttps://www.mathworks.com/matlabcentral/profile/authors/12004227-alice-faisaltag:www.mathworks.com,2005:Question/4250352018-10-20T00:51:42Z2018-10-20T01:32:45ZHow to solve "Error using .* Matrix dimensions must agree."?<p>My code is to use Hormomorphic filtering.But i am having an error like matrix dimension must agree.I read many answers related to this but I don't understand how to apply it to my code.
My image resolution size is 1935*2400.Is it the problem or how can i solve this problem?</p><p>I = imread('cephalogram.bmp');</p><p>I = im2double(I);</p><p>I = log(1 + I);</p><p>M = 2*size(I,1) + 1;</p><p>N = 2*size(I,2) + 1;</p><p>sigma = 10;</p><p>%create the high-pass filter...</p><p>[X, Y] = meshgrid(1:N,1:M);</p><p>centerX = ceil(N/2);</p><p>centerY = ceil(M/2);</p><p>gaussianNumerator = (X - centerX).^2 + (Y - centerY).^2;</p><p>H = exp(-gaussianNumerator./(2*sigma.^2));</p><p>H = 1 - H;</p><p>imshow(H,'InitialMagnification',25);</p><p>H = fftshift(H);</p><p>If = fft2(I, M, N);</p><p>Iout = real(ifft2(H.*If));</p><p>Iout = Iout(1:size(I,1),1:size(I,2));</p><p>Ihmf = exp(Iout) - 1;</p><p>imshowpair(I, Ihmf, 'montage');</p>Nayana Rhttps://www.mathworks.com/matlabcentral/profile/authors/13888825-nayana-rtag:www.mathworks.com,2005:Question/4238512018-10-13T21:04:21Z2018-10-20T01:31:21ZIs there any implementation of XGBoost algorithm for decision trees in Matlab?<p>I've found other boosting algos available in fitensemble and fitcensemble options but not XGBoost. Any chance to find it somewhere else?
Thanks</p><p>Roberto</p>Robertohttps://www.mathworks.com/matlabcentral/profile/authors/5700959-robertotag:www.mathworks.com,2005:Question/1400812014-07-03T13:44:33Z2018-10-20T01:26:30ZLoading mat files in matlab created from octave<p>I have this .mat file created from octave, which contains structures.
When I wanted to load the mat files from matlab, it shows an error. How to load these files?</p><pre class="language-matlab">>> y = load('murikhao.mat')
Error using load
Unable to read MAT-file murikhao.mat: not a binary MAT-file.
Try LOAD -ASCII to read as text.
</pre><p>adding '-ascii' parameter didnt help.</p>Adib Zamanhttps://www.mathworks.com/matlabcentral/profile/authors/2484216-adib-zamantag:www.mathworks.com,2005:Question/4250322018-10-20T00:24:20Z2018-10-20T01:25:14ZMy professor is driving me crazy. <p>So i have the following exercise
i have to use this formula with a t that starts at 0 and goes all the way to 50 with a step of 5. calculate and present in a table.
i did this,</p><pre class="language-matlab">step=5
tmax=50
X = [0:step:tmax;10*(1-exp(-0.2*(0:step:tmax)))];
</pre><p>and he said to me that the formula is not correct. I have been staring at it for an hour and it's driving me nuts. Can someone please explain to me were i went wrong and why? :/</p><img src = "/matlabcentral/answers/uploaded_files/137202/Untitled.png"><p>formula</p>Athanasios Naminsenoiazihttps://www.mathworks.com/matlabcentral/profile/authors/13896182-athanasios-naminsenoiazitag:www.mathworks.com,2005:Question/4241982018-10-16T03:45:51Z2018-10-20T01:07:48ZHi, I want ask you why the size of graycomatrix 8 x 8 ? that size default 8 x 8 or how ?<p>sir I example matrix gray = [0 1 2 2; 1 1 2 1; 1 0 2 0;];
but after I m=graycomatrix(gray);
the result like this :</p><p>m =</p><pre> 0 0 0 0 0 0 0 2
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 5</pre>Oman Wisnihttps://www.mathworks.com/matlabcentral/profile/authors/13491522-oman-wisnitag:www.mathworks.com,2005:Question/3786242018-01-23T19:26:28Z2018-10-20T00:52:30ZStoring values of multiple vectors into one 1:100 matrix?<pre class="language-matlab">v1=50
v3=75
</pre><pre class="language-matlab">i2=zeros(1, 100)
</pre><pre class="language-matlab">for v2=1:100
b=[v1; v2; v3]
y=L\b
x=U\y
end
</pre><p>I am using LU decomposition for the equation Ax=b to solve for the current (x=[i1; i2; i3]) when the voltage (b) is v1=50, v3=75, and every value of v2 from 1 to 100. I already have all the values in the 3x3 matrix for resistance values (A). I need to save all the values of i2 that correspond to the changing v2 values and save them all into a 1x100 matrix.</p>Isabella Pollockhttps://www.mathworks.com/matlabcentral/profile/authors/11857674-isabella-pollocktag:www.mathworks.com,2005:Question/4245342018-10-17T14:49:32Z2018-10-20T00:31:49ZNewton Rhapson for multivariable functions <p>I am trying to make a program that can solve multivariable equations using the iterative newton rhapson method, but I don't have too much experience in programming or Matlab. This is the formula for the iterative method:</p><pre class="language-matlab">x^(k+1) = x^k - [(f'(x^k))^-1]*f(x^k)
</pre><p>The givens for this are the 2 function f1(x1,x2) and f2(x1,x2) and our initial conditions x1 and x2. Then we have to solve the equations for a certain amount of iterations. x^k, x^(k+1), and f(x^k) are 2x1 matrices. (f'(x^k))^-1 is a 2x2 matrix. Here is what I have so far, but I got stuck with the loop:</p><pre class="language-matlab">%% Newton Rhapson
</pre><pre class="language-matlab">clear;
clc;
close;
</pre><pre class="language-matlab">x1 = 0; %initial values (given)
x2 = 1;
</pre><pre class="language-matlab">initial = (x1,x2);
I = transpose(initial);
</pre><pre class="language-matlab">f1 = 2x1^2 + x2 - 8; %function 1
</pre><pre class="language-matlab">f2 = x1^2 - x2^2 + x1*x2 - 4; %function 2
</pre><pre class="language-matlab">A = (f1,f2)
fx = A.' % transopose of A to give f(x)
</pre><pre class="language-matlab">df1 = diff(f1,x1); %differentiates f1 wrt x1)
df2 = diff(f1,x2);
df3 = diff(f2,x1);
df4 = diff(f2,x2);
</pre><pre class="language-matlab">df = [df1,df2;df3,df4]; %2x2 Matrix with differentials
</pre><pre class="language-matlab">for i = 1:4
y = initial - inv(df)*fx
</pre>curly133https://www.mathworks.com/matlabcentral/profile/authors/12057482-curly133tag:www.mathworks.com,2005:Question/4250102018-10-19T20:27:01Z2018-10-20T00:30:33ZSimbiology installed but not recognized in App<p>I am new to MatLab and could use some help. In preparation for a webinar next week on gPKPDSim I installed MatLab. The instructions for gPKPDSim say that to run the program I also need to install 'GUI Layout Toolbox 2.3.1.mltbx', 'SimBiologyNCA.mltbx"), and 'gPKPDSimToolbox.mltbx".</p><p>I used the 'installedToolbox = matlab.addons.toolbox.installToolbox(toolboxFile,agreeToLicense)' command and successfully installed all three toolboxes with all three showing in the Add-On Manager as installed. When I run the gPKPDSim App I however get an an error from this code</p><pre> if isempty(ver('simbio'))
error('This app requires SimBiology tool to run');
end </pre><p>When I give the 'ver' command only the GUI Layout Toolkit is shown. I have added the paths
'C:\Program Files\MATLAB\R2018a\toolbox\matlab\connector2\shadowfiles\shadows\simbiology' and 'C:\Users\langston\Documents\MATLAB\Add-Ons\Toolboxes\SimBiologyNCA\code'. After restarting MatLab I get the same error for Simbiology. I expect to later get an error for gPKPDSimToolbox.</p><p>How do I get the gPKPDSim App to recognize these missing toolboxes?</p><p>Thanks,
Cory</p>Cory Langstonhttps://www.mathworks.com/matlabcentral/profile/authors/13850426-cory-langstontag:www.mathworks.com,2005:Question/4250342018-10-20T00:27:36Z2018-10-20T00:27:36ZUsing Simulink as an external plant model for an existing controller<p>I'm unsure how to approach this task, using Simulink Real-Time, Simulink Coder "external mode" or something else. Looking for guidance. We are going to modify an existing UAV autopilot (ArduPilot), which for now will be running on an Ubuntu platform (later on PixHawk). We need a realistic plant model to test control model changes. We have talented controls engineers who can create a realistic plant model in Simulink. We'd like to run the existing autopilot code on Linux and have it communicate using TCP or UDP on Ethernet with a running instance of Simulink somewhere else (e.g. on Windows, but could be on the same Linux machine). The autopilot provides control inputs to the plant model to move control surfaces, spin motors, etc, and the plant model responds in real-time with, for example, lateral accelerations, angular velocities, changes in latitude, and longitude, etc. Reading documentation on-line, I'm not sure which products to use. I can create code in ArduPilot to send/receive whatever packets are necessary, but I don't know how to enable the Simulink side of this. Any ideas?</p>Victor Sperryhttps://www.mathworks.com/matlabcentral/profile/authors/13510546-victor-sperrytag:www.mathworks.com,2005:Question/4246722018-10-18T04:52:00Z2018-10-20T00:25:12ZQuestion about a problem<p>I have a textfile which I've already unpacked into a vector.</p><p>Each value (units: lbs) in the textfile is a minute of fuel consumption of a airplane's flight. So as an example, the 50th value (let's the value is 325 lbs) is the 50th minute value, and the plane's total consumption from beginning of takeoff to 50th minute is 325 lbs.</p><p>Now here is the question being asked.</p><p>I am asked to find how long the takeoff portion of the flight lasts. The following is the information I am given.</p><p>I am told to use the first half of the dataset.</p><pre class="language-matlab">FirstHalf = A(1:length(A)/2,:)
</pre><p>Next, I have found the average total consumption rate (simply took the last value in the text file/divided by total minutes). I am told the average total consumption rate is 1.5 times the average rate at takeoff. So simple maths gives us AvgTakeoff = AvgTotal/1.5. Now I have the average takeoff rate (in units of lbs/min), but I need to find out how long does the takeoff last (in minutes)? Can i do this using For Loops or If statements?</p>FanOf23https://www.mathworks.com/matlabcentral/profile/authors/13873393-fanof23tag:www.mathworks.com,2005:Question/4230462018-10-09T14:04:02Z2018-10-20T00:23:07ZHow to generate numbers from probability mass function?<p>Hallo,</p><p>Given a probability mass function defined as P(X=3)=0.2, P(X=7)=0.3 and P(X=10)=0.5, I want to generate randomly 30 numbers (values for X) with this probability mass function as base. But I really have no idea how and where to start.</p><p>Can somebody help me?</p><p>Thank you in advance</p>Clarisha Nijmanhttps://www.mathworks.com/matlabcentral/profile/authors/9730139-clarisha-nijmantag:www.mathworks.com,2005:Question/4249212018-10-19T10:29:41Z2018-10-20T00:00:18ZHow to use neural networks for spatial prediction ?<p>Hello Everyone
I have data of n different location spread all over my study area, each location has a number of independent variables and only one target variable. Some of the independent variables are static like the latitude, longitude, and (mean, min, and max) altitude, while the others are time series variables like the precipitation and temperature, the target variable is also a time series variable. My question is: how to arrange the independent variables (static and time series) to be used within the neural networks for the application of spatial prediction? is the structure in the attached image is right, where I have repeated the values of the static variables for each time series variable within each location?</p><p>My second question is how to normalize the input variables of the same type as the mean, min, and max altitude? Should I need to normalize them independently like the other variables or I should normalize them like a single variable?</p>ALI SUBHI ABBOODhttps://www.mathworks.com/matlabcentral/profile/authors/11531731-ali-subhi-abboodtag:www.mathworks.com,2005:Question/2846802016-05-17T23:33:41Z2018-10-19T23:49:26ZHow do i convert a Python Pandas Dataframe to Matlab types?<p>I am calling a python function from Matlab code which returns a Pandas Dataframe. I would like to convert the content of the DataFrame to Matlab data types, but I can't find the correct way to do it. Thanks in advance for any help on this.</p>Ricardo Alveshttps://www.mathworks.com/matlabcentral/profile/authors/5633843-ricardo-alvestag:www.mathworks.com,2005:Question/4250302018-10-19T23:10:37Z2018-10-19T23:48:16ZBuilt-in Documentation broken, how do I get it working again?<p>A few months ago the built in documentation would never open no matter what I typed in and however many times I tried. I thought that updating MATLAB would fix the problem. It did not. I upgraded from 2018a to 2018b today and the built in documentation still does not display anything. A ghost window opens up in the background, but is not highlighted initially. I need to go to my taskbar and click on the separate window to show it. It is the smallest window you can imagine in the upper left corner with no content whatsoever. When I click on it, it closes automatically. Please advise.</p>Michael Gerald Hastingshttps://www.mathworks.com/matlabcentral/profile/authors/10768282-michael-gerald-hastingstag:www.mathworks.com,2005:Question/4250312018-10-19T23:42:04Z2018-10-19T23:43:28Zhow do i know which filter should i use?<p>Hi guys, I have been working on a smartphone sensor and I have the data. it consists of time acceleration in x y z-direction. so i tried to plot the time history of all three in one graph and guess what, it comes up. can anybody clear this issue for me? secondly, when I run FFT for the data it shows a lot of peaks(it should be showing a few peaks right?) I know there is noise in the signal but then I don't know which filter to use. how am I suppose t know which kind of filter is suitable for which condition. and how am I suppose to remove the peaks now.. I</p><img src = "/matlabcentral/answers/uploaded_files/137197/Capture.JPG"><pre> have attached the data file (the data i used is till row 3767). i used the following code,,</pre><p>%% Import data from text file.
% Script for importing data from the following text file:
%
% F:\Masters BUW\MASTER ARBEIT\Sensor Simulation\Data\SM-G950F_samsung_dreamltexx.csv
%
% To extend the code to different selected data or a different text file,
% generate a function instead of a script.</p><p>% Auto-generated by MATLAB on 2018/10/19 00:51:50</p><p>%% Initialize variables.
filename = 'F:\Masters BUW\MASTER ARBEIT\Sensor Simulation\Data\SM-G950F_samsung_dreamltexx.csv';
delimiter = ' ';
startRow = 23;
endRow = 3767;</p><p>%% Format for each line of text:
% column1: double (%f)
% column2: double (%f)
% column3: double (%f)
% column4: double (%f)
% For more information, see the TEXTSCAN documentation.
formatSpec = '%f%f%f%f%*s%*s%[^\n\r]';</p><p>%% Open the text file.
fileID = fopen(filename,'r');</p><p>%% Read columns of data according to the format.
% This call is based on the structure of the file used to generate this
% code. If an error occurs for a different file, try regenerating the code
% from the Import Tool.
dataArray = textscan(fileID, formatSpec, endRow-startRow+1, 'Delimiter', delimiter, 'MultipleDelimsAsOne', true, 'TextType', 'string', 'EmptyValue', NaN, 'HeaderLines', startRow-1, 'ReturnOnError', false, 'EndOfLine', '\r\n');</p><p>%% Close the text file.
fclose(fileID);</p><p>%% Post processing for unimportable data.
% No unimportable data rules were applied during the import, so no post
% processing code is included. To generate code which works for
% unimportable data, select unimportable cells in a file and regenerate the
% script.</p><p>%% Allocate imported array to column variable names
tim = dataArray{:, 1};
x = dataArray{:, 2};
y = dataArray{:, 3};
z = dataArray{:, 4};</p><p>%% Clear temporary variables
clearvars filename delimiter startRow endRow formatSpec fileID dataArray ans;
%%mydata
t=tim-3.103056357614000e+03;
accx=detrend(x, 'constant');
accy=detrend(y, 'constant');
accz=detrend(z, 'constant');</p><p>X= [accx, accy, accz];</p><p>%
for i = 1:1:3
subplot(3,1,i)
plot(t,X(i))</p><pre> end</pre><p>Fs= 50;
T= 1/Fs;
L=3745;
time= (1:L-1)*T;</p><p>accxx= detrend(accx);</p><p>NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(accxx,NFFT,1);
f = Fs/2*linspace(0,1,NFFT/2);</p><p>% Plot single-sided amplitude spectrum.
figure
plot(f,abs(Y(1:NFFT/2)))
title('Single-Sided Amplitude Spectrum of y(t)')
xlabel('Frequency (Hz)')
ylabel('|Y(f)|')</p>Sheraz Khanhttps://www.mathworks.com/matlabcentral/profile/authors/11838928-sheraz-khantag:www.mathworks.com,2005:Question/2707022016-02-29T23:42:13Z2018-10-19T23:41:39ZMultiply each item of an array with every item of another array<p>Dear matlab community,</p><p>I have a relatively simple problem:</p><p>I have two arrays, say:</p><p>1</p><p>2</p><p>3</p><p>and</p><p>10</p><p>11</p><p>12</p><p>I would like to multiply each of the first vector items with every of the second vector items, and print a new vector, which gives the output:</p><p>1*10</p><p>1*11</p><p>1*12</p><p>2*10</p><p>2*11</p><p>2*12</p><p>3*10</p><p>3*11</p><p>3*12</p><p>Thank you very much, I appreciate your help!</p><p>Greetings from Australia,</p><p>Chris</p>Christoph Meierhttps://www.mathworks.com/matlabcentral/profile/authors/6207659-christoph-meiertag:www.mathworks.com,2005:Question/4250252018-10-19T22:38:53Z2018-10-19T23:21:46ZWhat is the solution of this problem? this is array 13*13<img src = "/matlabcentral/answers/uploaded_files/137192/Screenshot%20(326).png">aey viphttps://www.mathworks.com/matlabcentral/profile/authors/13872471-aey-viptag:www.mathworks.com,2005:Question/4250042018-10-19T20:09:23Z2018-10-19T23:19:53ZHow can I update a text in app designer when Matlab script is running?<p>I created a GUI in app designer that a user chooses variables and then it will run the function in Matlab. For this, I tried to use the diary function to write to a file what is output to the command window that would then use drawnow to send to the GUI. I am having problems because I am not sure how to update the label in the GUI with the text output from my function. Attached is the code for trying to set the label and the error message that is given by app designer.</p><pre> if options.gui % stop coping outputs to command window and send to GUI
diary off;
output = fileread('diary');
set(app.Label,'string',output); % fill in 'textbox_handle' with the actual handle for the textbox
drawnow;
end</pre><ul><li><i>Undefined variable "app" or class "app.Label".</i>*</li></ul><p>-Thanks</p>Thomas Firsichhttps://www.mathworks.com/matlabcentral/profile/authors/10079099-thomas-firsichtag:www.mathworks.com,2005:Question/4250072018-10-19T20:16:36Z2018-10-19T23:17:51ZWhat am I doing wrong with syms?<p>Hello everybody
I am trying to make a program that simulates a ray going through a 2d matrix on a set angle, and then highlight the path. When I get to the syms part, I get the "Unable to find explicit solution" error many times. What am I doing wrong there?
Thanks in advance!!</p><pre class="language-matlab">clc
clear all
close all
a=randi([0,64],[6,6]); %create a 6*6 matrix with random values
first_row=1; %set entry point coords
entrypoint=3; %set entry point coords
a(first_row,entrypoint)=0; %pinpoint the entry point in the matrix
angle=45; %set an angle
y(1)=entrypoint; %we're gonna need these in the loop
x(1)=first_row; %we're gonna need these in the loop
for i=2:1:length(a) %repeat till it reaches the end of the matrix
syms x(i) y(i) %define the 2 unknown factors
x(i)=(((y(i)-y(i-1))*(sind(90-angle))/sin(angle))+x(i-1)); %based on A/sin(a)=B/sin(b)
y(i)=((x(i)-x(i-1))*tand(angle)+y(i-1));%based on A/sin(a)=B/sin(b)
t=floor(solve(x(i))); %solve for y
z=floor(solve(y(i))); %solve for x
a(t,z)=0; %highlight the "path" on matrix a
end
</pre><pre> t %check
z %check
a %check
image(a) </pre>Serafeim Klimantirishttps://www.mathworks.com/matlabcentral/profile/authors/10674978-serafeim-klimantiristag:www.mathworks.com,2005:Question/4249802018-10-19T17:25:03Z2018-10-19T23:09:25ZMultiplying a matrix by a function<p>How can I multiply a matrix by a function of time so that my answer is a time dependent function?</p><p>For example: say u(t)=P*n(t)</p><p>n(t) is a function of time and P is a 5x5 matrix.
I am trying to put this in matlab so that I can graph u(t) vs time.</p>Denikka Brenthttps://www.mathworks.com/matlabcentral/profile/authors/12112693-denikka-brenttag:www.mathworks.com,2005:Question/4250282018-10-19T22:47:10Z2018-10-19T23:05:51ZMatrix pre-allocation question<p>I have attached an image of some code I'm working through. I have pre-allocated two matrices but MATLAB is still displaying the message suggesting I pre-allocate. I'm trying to determine whether it shows this message regardless of whether I've already done what it's asking me to do or not. My assumption was this message would disappear once I pre-allocated but that's not been the case.</p><img src = "/matlabcentral/answers/uploaded_files/137193/Screenshot.png">Jaredhttps://www.mathworks.com/matlabcentral/profile/authors/4852768-jaredtag:www.mathworks.com,2005:Question/3448212017-06-14T23:18:59Z2018-10-19T23:05:22ZHow to include arduino libraries in Matlab<p>Hi everyons,
sorry if this question has already been answered, but I have been working on some projects using arduino and the coolterm or telemetry programs (to save the data) for a research project. While it works nicely, it is a bit cumbersome to use two different programs. So I was thinking of using Matlab. However, I am unsure how to include the arduino libraries. Specifically I am using the Adafruit MPR121 Capacitive Tuoch Sensor board with the associated libraries. Thanks
Bart</p>Bart Ellenbroekhttps://www.mathworks.com/matlabcentral/profile/authors/6276770-bart-ellenbroektag:www.mathworks.com,2005:Question/4250292018-10-19T22:58:18Z2018-10-19T22:58:18ZSuiteSparse Installation: Cannot open include file: 'regex.h'<p>I am having issues installing SuiteSparse in Matlab. I am using the 5.3 version, downloaded from <a href = "http://faculty.cse.tamu.edu/davis/suitesparse.html">http://faculty.cse.tamu.edu/davis/suitesparse.html</a>, and using the Visual Studio 2017 C++ compiler. When I run SuiteSparse_install, I get the following error:</p><p>c:\users\dylan\documents\school\masters\suitesparse\metis-5.1.0\gklib\GKlib.h(68): fatal error C1083: Cannot open include file: 'regex.h': No such file or directory</p><p>And UMFPACK, KLU, CHOLMOD, SuiteSparseQR fail to install. Has anyone got any experience with this, or could point me in the right direction for assistance? I need the sparse2 and spqr functions for my code, as I have a very large over-determined, sparse system to solve, and it is giving Matlab's mldivide a rough time. Thanks!</p>Dylan Zaluskihttps://www.mathworks.com/matlabcentral/profile/authors/5845587-dylan-zaluskitag:www.mathworks.com,2005:Question/2763772016-03-31T13:37:55Z2018-10-19T22:53:19ZWhy want the code generation examples open?<pre class="language-matlab">openExample('simulinkcoder/GettingStartedSimulinkCoderExample')
</pre><pre class="language-matlab">Undefined function or variable 'openExample'.
</pre><p>What is the issue here, are these examples no longer supported?</p><p>I have R2015b and the example was from a much earlier Matlab, I tried other methods to open it and none worked, I also did not see it under the demos help functions.</p>Gary Herringtonhttps://www.mathworks.com/matlabcentral/profile/authors/7753210-gary-herringtontag:www.mathworks.com,2005:Question/4250132018-10-19T20:45:30Z2018-10-19T22:47:35ZFind one of strings into cell array<p>Hello all!</p><p>I have an cell array 'inputs' with strings and numbers and I need find where one of the strings from an another cell array of strings is located.</p><pre class="language-matlab">inputs = {'str1' 'str2' 'str3' single(1.5) 'str4' uint16(500) 'str5' single(2)};
</pre><p>In order to check if 'str1' belongs to 'inputs' and gets its index I do:</p><pre class="language-matlab">find(strcmpi(inputs, 'str1'))
ans = 1
</pre><p>But if I want to find where one string of a cell array of strings is located</p><pre class="language-matlab">find(strcmpi(inputs, {'str1' 'str3' 'str4'}))
Error using strcmpi
Inputs must be the same size or either one can be a scalar.
</pre><p>I would like to see</p><pre class="language-matlab">ans = 1 3 5
</pre><p>Also 'ismember' doesn't work as 'inputs' has numbers as well. Then I wrote:</p><pre class="language-matlab">cellfun(@(c)strcmpi(c,inputs),{'str1' 'str3' 'str4'},'UniformOutput',false)
ans = 1×3 cell array
{1×8 logical} {1×8 logical} {1×8 logical}
</pre><p>Now I have the logical results as 1x3 of 1x8 and, if I could perform an OR operation and bring this 1x3(1x8) to 1x8, I could apply 'find' and get the right indexes. I have tried to use <i>OR</i> together with 'cellfun' but I failed miserably. At this point I reached this thread:</p><p><a href = "https://www.mathworks.com/matlabcentral/answers/277488-how-can-i-find-multiple-strings-in-a-cell-array">How can I find multiple strings in a cell array?</a></p><p>The solution was to use 'ismember' what is not possible in my case. So my questions are:</p><ol><li>Is there any way to perform <i>OR</i> operation with this 1x3(1x8) cell array and bring it to 1x8 without <i>FOR</i> loop?</li><li>Is there another approach to this problem?</li></ol><p>Thanks in advance for your support!</p>Laercio Barbosahttps://www.mathworks.com/matlabcentral/profile/authors/4281579-laercio-barbosatag:www.mathworks.com,2005:Question/4250032018-10-19T20:06:32Z2018-10-19T22:45:26ZCompute a free space/obstacle mask for an image (pixels) for pixel-level image segmentation<p>I am working with pixel-level image segmentation in Matlab. I am trying to build a model to classify each pixel in the RGB image either Free space (F) or Obstacle. If the pixel is belonging to an object outside a threshold distance from the camera location then it is free otherwise its an obstacle. The main challenge I have now is labeling the data set. Is there any way I can come up with an algorithm in Matlab that will do the labeling process automatically, apart from image labeler app, i.e compute a mask of (F)/(o) for the image?. Assuming that I have a synthetic 3d environment to collect images from by changing the position and orientation of the camera within the environment. So known things are :</p><p>1-Camera properties (focal length, sensor size,..etc)</p><p>2-Camera location within the environment (X, Y, Z)</p><p>3- Objects' location and dimensions.</p><p>please advise me if you have any suggestion.</p>caesarhttps://www.mathworks.com/matlabcentral/profile/authors/7647654-caesartag:www.mathworks.com,2005:Question/4250262018-10-19T22:39:25Z2018-10-19T22:39:25ZGraphic equalization gain. How to change the maximum/minimum gain applied in GraphicEQ block/Simulink<p>Hello everyone,
I would like to use the GraphicEQ block in Simulink but the problem I face is that the maximum/minimum gain is [-20,20], is it possible to change these values into higher gain values?
It would be really helpful to tell me a way to tackle this problem.
Thank you so much!</p>Mohannad AlQubbajhttps://www.mathworks.com/matlabcentral/profile/authors/12506676-mohannad-alqubbajtag:www.mathworks.com,2005:Question/4250242018-10-19T22:34:53Z2018-10-19T22:34:53Zpositive semi-definite matrix<p>I have obtained the correlation matrix of a signal, how can I make it positive semi-definite using matlab?</p>hanahttps://www.mathworks.com/matlabcentral/profile/authors/1676877-hanatag:www.mathworks.com,2005:Question/2666972016-02-04T22:44:42Z2018-10-19T22:32:09ZKnapsack problem using Dynamic Programming<p>I wrote a matlab code to solve a knapsack problem and can get the optimal value of the knapsack but I am trying to figure out how to return the list of items that would lead to this optimal value. Can anyone help me see an easy way to do this?</p><pre class="language-matlab">global N w r c items;
</pre><pre class="language-matlab">N=3; % number of different items to chose from
</pre><pre class="language-matlab">w = [3,8,5]; % weights of each item
</pre><pre class="language-matlab">r = [4,6,5]; % value of each item
</pre><pre class="language-matlab">c = 8; % total weight that can be carried
</pre><pre class="language-matlab">V = Val(1,c)
</pre><pre class="language-matlab">function V = Val(k,b)
</pre><pre class="language-matlab">global N w r;
</pre><pre class="language-matlab">% N - number of different items
</pre><pre class="language-matlab">% w - array of weights for each item
</pre><pre class="language-matlab">% r - array of values for each item
</pre><pre class="language-matlab">m = floor(b/w(k)); % determine max number of item k for budget b
</pre><pre class="language-matlab">p = 0:m; % array of possible numbers of each item given budget b
</pre><pre class="language-matlab">if k==N
</pre><pre> V = max(r(k)*p); % base case</pre><pre class="language-matlab">else
</pre><pre> temp = zeros(1,length(p));</pre><pre> % recursion step</pre><pre> for n=1:length(p)</pre><pre> % value of k+1 item given budget remaining if p number of item k is
% used</pre><pre> temp(n) = Val(k+1,b-w(k)*p(n)); </pre><pre> end</pre><pre> V = max(r(k)*p + temp); </pre><pre class="language-matlab">end
</pre><pre class="language-matlab">end
</pre>Adam Stevenshttps://www.mathworks.com/matlabcentral/profile/authors/4343522-adam-stevenstag:www.mathworks.com,2005:Question/4250232018-10-19T22:28:00Z2018-10-19T22:28:00ZHow best to model a mass spring system?<p>I am trying to model a crane as a sdof so firstly by means of a mass spring system in order to get its displacement (vibration) upon an impulse (load).</p><p>I have an equation (newtons law) for it with a mass equal to 177046.4 and stiffness of spring equal to 1.0513x10^13. The max load the crane can take is 10ton, but I have been advised that the impulse would be anything between 1-3 tonnes in magnitude.</p><p>Not sure how to model this to then also get a plot of vibration (displacement of crane vs time).</p><p>Thanks in advance.</p>Alexjas1997https://www.mathworks.com/matlabcentral/profile/authors/13919540-alexjas1997tag:www.mathworks.com,2005:Question/4237502018-10-13T00:40:19Z2018-10-19T22:23:31ZHow to set ItemsData using external file (App Designer)?<p>The purpose of my app is to create a UI which allows the user to select data they want to graph through a drop-down menu and adjust the graph to their liking through a series of edit fields. However, I am currently having trouble setting the ItemsData of my drop-down menu to the array variable from an external .mat file. Some of the difficulty stems from this being a multiwindowed app (based heavily on <a href = "https://www.mathworks.com/help/matlab/creating_guis/creating-multiwindow-apps-in-app-designer.html">this</a> tutorial). I am currently able to load the .mat file, but I can't figure out how to pass the array data to the popup window class and set it as an ItemData for the drop-down window.
Attached are .txt files for both the main window and the popup window.</p><p>I greatly appreciate any suggestions on how to solve this.</p>gage benhamhttps://www.mathworks.com/matlabcentral/profile/authors/12037122-gage-benhamtag:www.mathworks.com,2005:Question/4250222018-10-19T22:23:22Z2018-10-19T22:23:22ZWhat is the maximum size (in bytes) of a data store memory in Simulink?<p>What is the maximum size (in bytes) of a data store memory in Simulink?</p>Joe Wickerhttps://www.mathworks.com/matlabcentral/profile/authors/4598484-joe-wickertag:www.mathworks.com,2005:Question/4250212018-10-19T22:14:05Z2018-10-19T22:14:05ZHow to pass multi-dimensional cell array to matlab from python<p>Hello,</p><p> </p><p>I am able to pass a single-dimension cell array to MATLAB from Python using matlab.engine by passing a list:</p><pre class="language-matlab">A = [0, 1]
</pre><p>I can then access this in MATLAB as:</p><pre class="language-matlab">A{1}
</pre><p>However, in some of the existing MATLAB code I am working with, it indexes into multi-dimensional cell arrays:</p><pre class="language-matlab">A{1,1,5}
</pre><p>Passing a nested list from Python:</p><pre class="language-matlab">A = [[1,2],[3,4]]
</pre><p>allows me to access the entries as</p><pre class="language-matlab">A{1}{1}
</pre><p>but not as</p><pre class="language-matlab">A{1, 1}
</pre><p>How do I <b>correctly</b> pass a multi-dimensional cell array to MATLAB from Python using matlab.engine?</p>Sebastian Vhttps://www.mathworks.com/matlabcentral/profile/authors/13919485-sebastian-vtag:www.mathworks.com,2005:Question/4250202018-10-19T21:54:04Z2018-10-19T22:06:46ZHow to check after completing the Image Processing Machine Learning program.<p>I want to import a picture from the computer to test the program but do not know how.</p><pre class="language-matlab">%% Import Training Data
imgSets = imageSet('folder','recursive');
[imgSets.Count] %show the corresponding count of images
</pre><pre class="language-matlab">%% Prepare Training Image Sets
minSetCount = min([imgSets.Count]); %determine the smallest a mount of image in a
trainingSets = partition(imgSets, minSetCount, 'randomize');
[trainingSets.Count]
</pre><pre class="language-matlab">%% Create a Visual Vocabulary from Training Data
bag = bagOfFeatures(trainingSets,'Vocabularysize',100,'Pointselection','Detector');
</pre><pre class="language-matlab">%% Display Visual Word Occurrence Histograms
% that becomes a new and reduced representation of image.
img = read(imgSets(1), randi(imgSets(1).Count));
featureVector = encode(bag, img);
figure(1)
subplot(3,2,1); imshow(img);
subplot(3,2,2);
bar(featureVector); title('Visual Word Occurrences'), xlabel('Visual Word Index'); ylabel('Frequency of occurrences');
</pre><pre class="language-matlab">img = read(imgSets(2), randi(imgSets(2).Count));
featureVector = encode(bag, img);
figure(1)
subplot(3,2,3); imshow(img);
subplot(3,2,4);
bar(featureVector); title('Visual Word Occurrences'), xlabel('Visual Word Index'); ylabel('Frequency of occurrences');
</pre><pre class="language-matlab">img = read(imgSets(3), randi(imgSets(3).Count));
featureVector = encode(bag, img);
figure(1)
subplot(3,2,5); imshow(img);
subplot(3,2,6);
bar(featureVector); title('Visual Word Occurrences'), xlabel('Visual Word Index'); ylabel('Frequency of occurrences');
</pre><pre class="language-matlab">%% Train a classifier to discriminate between categories
categoryClassifier = trainImageCategoryClassifier(trainingSets, bag); % Train Category Clssifier
</pre><pre class="language-matlab">%% Evalute Classifier Performance on Training Set
confMatrix = evaluate(categoryClassifier, trainingSets);
</pre>Huynh Thanh Sanghttps://www.mathworks.com/matlabcentral/profile/authors/13851363-huynh-thanh-sangtag:www.mathworks.com,2005:Question/4244932018-10-17T11:33:38Z2018-10-19T21:54:12ZHow to set BoundType Conditional to PortfolioCVar Object ?<p>How can I set the lower bounds of a PortfolioCVar object conditional to be 0 or 0.02 (for example) ? This function exists in the Portfolio object, but not in PortfolioCVar. Is there another way to do it ?</p>Flaviohttps://www.mathworks.com/matlabcentral/profile/authors/7438487-flaviotag:www.mathworks.com,2005:Question/4245432018-10-17T15:11:38Z2018-10-19T21:48:41ZHow can I convert a equation into an character array?<p>Hi community,</p><p>I want to convert an equation like: N=1-X into an character array like: Z='N=1-X' or the other way around.
The problem is functions like string2num() do not accept variables as input.</p>Emre Sahinhttps://www.mathworks.com/matlabcentral/profile/authors/7811915-emre-sahintag:www.mathworks.com,2005:Question/4250192018-10-19T21:40:14Z2018-10-19T21:40:14Zlibmx.dll not found<p>I am trying to build an application in C++ using Visual Studio 2017. I have added paths in the directory as recommended https://www.youtube.com/watch?reload=9&v=vQ5aIxCX3To.
Somehow I get an error - libmx.dll not found.
I tried following - I copied this dll from bin\win64 and pasted it in the solution directory. After this I got error saying a different dll is missing.
Then I tried to copy entire bin\win64 in a different location and added that path. Still the same error.
Please help me resolve the issue.</p><img src = "/matlabcentral/answers/uploaded_files/137189/CppDirectories.png"><p>When I generate mex from my code it works just fine, but I can't run the code in Visual Studio-17.
Thanks</p>PThttps://www.mathworks.com/matlabcentral/profile/authors/6743559-pttag:www.mathworks.com,2005:Question/4250182018-10-19T21:39:45Z2018-10-19T21:39:45Zwhat is the best speed Observer for my SynRM (motor) that may be impemented in simulink model ?<p>i have non lineair model in Simulink, i tried to synthetise a non lineair observer for speed parametre ,where sensoless control of the machine (synchronouse reluctance motor) is requiered
till now i have medeled the motor then started with flux estimator but doesnt work
i will be so thankfull if someone could help !</p>BOUSSOUAR essalihhttps://www.mathworks.com/matlabcentral/profile/authors/5801164-boussouar-essalihtag:www.mathworks.com,2005:Question/4250162018-10-19T21:28:51Z2018-10-19T21:37:48ZHow can i implement a division with matlab for an HLD code generation?<p>I need to find the inverse of a matrix for a HDL code generation</p>Sara Baghaeihttps://www.mathworks.com/matlabcentral/profile/authors/9965680-sara-baghaeitag:www.mathworks.com,2005:Question/4236062018-10-12T08:25:00Z2018-10-19T21:37:15ZPut a given sequence on time slots<p>For example, I have 48-time slots (t) and I want to put a block of a sequence [1,1,0,0] on these time slots randomly from (t+n) to (t+n+4). How can i generate such a sequence.</p>Daudhttps://www.mathworks.com/matlabcentral/profile/authors/5430403-daudtag:www.mathworks.com,2005:Question/4243632018-10-16T19:59:03Z2018-10-19T21:27:52ZHow to build an S-function with nested C++ source code? (The source code has a lot of folders and sub-folders)<p>I have tried finding helpful resources but I just got this one
https://www.mathworks.com/help/simulink/examples/custom-code-and-hand-coded-blocks-using-the-s-function-api.html
However, I could not find a description about this example. Can someone explain it a bit?
Some basics and entry level pointers would be really helpful. Thanks!</p>Rachit Shahhttps://www.mathworks.com/matlabcentral/profile/authors/13083347-rachit-shah