COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Matlab Emdebbed - Dynamic Vector size

• Email
• Follow

```Hi,

is there any chance to define a dynamic vector size in Matlab Embedded?

The implementation would be as described below:

I want to use dynamic Weibull Analysis on Fault Events, hence the vector containing the times of fault events is continuously increasing as more events are occuring. The matlab function 'wblfit' does only work on elements > 0, hence i need a method without predefining the vector containing all elements as zeros(nx,1) and then run the simulation until nx events occured (if i predefine it with ones(nx,1) or something else > 0, the analysis would be wrong, as events that did not occur would be taken into account).

Maybe ana one of you can help me, finally i just need a method to use a dynamic vector as 'persistent' variable in Matlab Embedded Code for Simulink!

Heiko
```
 0

See related articles to this posting

0 Replies
439 Views

Similar Articles

12/19/2013 3:55:34 AM
page loaded in 388930 ms. (1)

Similar Artilces:

Sizing a vector of vectors
Hello, I'm trying to size a vector of vectors of unsigned ints to be an NxN square. Here's how I'm doing it: typedef vector<vector<unsigned int> > tournament_type; unsigned int n; tournament_type tournament; // Go get a value for n... tournament.resize(n); for_each( tournament.begin(), tournament.end(), bind2nd(mem_fun1(&tournament_type::value_type::resize), n) ); On the platform I'm on (VC++ 7.1), I get an internal compiler error. Before I go over to the VC++ group, I'd like to make sure this code should...

Is there a way I can create a vector of vectors using Matlab?
I need a vector whose elements are also vectors. My approach was: for i=1:length(t) v=[]; for j=1:na if (i-j)<1 v=[v,0]; else v=[v,-y(i-j)]; end end for j=1:nb if (i-j)<1 v=[v,0]; else v=[v,u(i-j)]; end end phi_t(i)=v; end where phi_t is the vector of vectors that I need. When phi_t(i)=v is evaluated I get the error: ??? In an assignment A(I) = B, the number of elements in B and I must be the same. Is there a way I can do t...

change matlab workspace font size and editor font size
dear all I wish to change the workspace font size and the editor font size. How do I do it? Thanks in advance, Thanks I have the suggestion in another question posted earlier. "langtran" <lang.tran@iom-world.org> wrote in message news:7795881.1207239680638.JavaMail.jakarta@nitrogen.mathforum.org... > dear all > I wish to change the workspace font size and the editor font size. How do > I do it? > Thanks in advance, Open the Preference window using the Preferences menu item on the File menu. There is a Fonts item in the Preferences that will let ...

Vectorization in MATLAB
Hey everyone, I was wondering exactly how vectorization works in matlab. Specifically, why is it that loops are so inferior to vector operations? Most explanations that I've encountered thus far only offer hand-waving explanation or are very vague. Thus far I've gleaned that since matlab is an interpreted language, it can't perform many optimizations on loops (as it wont be able to derive any long-term information about the loop, so no loop unrolling or any other compiler-derived optimizations can be applied), while when vectorizing code, you're accessing some standard libra...

how to vectorize this in matlab
hi all i want to eliminate the for statement...but the boundaries need to be fixed. is there a better way of writing this? i am using matlab. thanks d(1) = fi(2) - a*fi(1); d(79) = fi(80) - c*fi(81); for i = 3:79 d(i) = fi(i-1) end where a and c are scalars. matlab_learner <cibeji@gmail.com> wrote in message <91bf19f3-7065-4fe4-a6e5-1b7395c3eb8c@w27g2000pre.googlegroups.com>... > hi all > i want to eliminate the for statement...but the boundaries need to be > fixed. is there a better way of writing this? i am using matlab. > ...

vector sizing
I have a n-sized vector PVEC of p-values. I want to form a new (n-k)-sized vector containing only the p-values<0.05, thereby excluding the k p-values>0.05. Visually the solution works, as shown, but I am unable to form the new (n-k)-sized vector. % for i=1:n if pvec(i)<0.05 [i pvec(i)] end if pvec(i)>0.05 [0 pvec(i)] end end % Anyone could help me with this simple problem? Thanx in advance, guido. guido wrote: > > > I have a n-sized vector PVEC of p-values. I want to form a new > (n-k)-sized vector containing only the p-values<0.05, thereby > excluding the k p-va...

Matlab-graph text font size and enlarging window size automatically
Hi, I'm plotting three subplots on one figure and the labels (x and y and title) are all intefering with each other. How can I enlarge the window that appears (without manually using the maximize button) or reduce the text size or make sure the text doesnt overlap? Also on a seperate note if I want to make an if statement that makes sure a value is an integer how can I do that?? i.e if num isnt integer num = 1 end Thanks in advance Dan Hi, in edit, file object properties you can change the size and the font of every label and title. For the other question, I don't know John...

Fixed size vector
I would need something in theory quite simple, a vector of a certain size, which, when I add something and it's full, simply deletes the last entry. If for example I have MyContainer x(3); x.push(1); x.push(2); x.push(3); x.push(4); it should contain now <4, 3, 2> I don't see any of the STL structures doing exactly what I would like, any suggestions on how to implement it? Andrea Crotti <andrea.crotti.0@gmail.com> writes: > I would need something in theory quite simple, a vector of a certain > size, which, when I add something and it's ...

Vector Plot in MATLAB
I'm trying to help someone do a project in MATLAB. They were given this information: --- The velocity vector of the wind can be expressed in terms of the slope (the tangential line) at any point on the circle as (1,m), where m is the slope. Find the velocity vector for a wind speed of 35 m/s. --- In MATLAB, whenever I use a quiver plot for my own work, I always have functions that describe the u and v components. You can also give it explicit values for the components. But I'm not really sure how to get vector components to use in MATLAB for the info above (it's been a l...

How to reduce size of a vector?
Hi! I have a vector A (4573x1). I want to reduce the size in such a way to put 2 consecutive elements of A into a new vector B (2287x1). E.g. A(1) & A(2) -> B(1) A(3) & A(4) -> B(2) .. .. .. Thanks. Linda Linda wrote: > Hi! > > I have a vector A (4573x1). > I want to reduce the size in such a way to put 2 consecutive elements of A > into a new vector B (2287x1). > > E.g. > A(1) & A(2) -> B(1) > A(3) & A(4) -> B(2) I this what you want? B = A(1 : 2 : end - 1) + A(2 : 2 : end); -Herbert ...