Risposto
How do you create a matrix Aij where each value is determined by a formula?
It sounds like a for loop would build your matrix nicely: n = 2000; sz_i = n; sz_j = n; A = zeros(sz_i, sz_j); % Preallocate...

oltre 2 anni fa | 0

Risposto
Simulink asynchronous generator voltage input clarification
Hi Abd, For an induction machine to operate, you must be able to generate a rotating field on both the rotor and stator. The fi...

oltre 2 anni fa | 1

| accettato

Risposto
What is the difference between in64, int32, and int8. Are there anymore 'int' functions? (int means integer right?)
Difference between %d, %f, or any other %? These are formatting control codes. %d prints a number in decimal (base 10) format, ...

oltre 3 anni fa | 0

| accettato

Risposto
How to display a Y value
For interactive use of the graph, consider use of the datatips functionality. In R2018 and above, if you hover your cursor over ...

oltre 3 anni fa | 0

| accettato

Risposto
index exceeds matrix dimensions and the toolbox code error
I'd guess that n is larger than the size of P. In the first couple lines it seems that P only gets allocated if the swing angle ...

oltre 3 anni fa | 0

Risposto
How to apply modifiers to error messages
You've almost got it. The TeX formatting is correct. You need to include the interpreter and modality of the window in a struct ...

oltre 3 anni fa | 1

| accettato

Risposto
How to impulse response including unit step function
The Heaviside step function is defined Substitute a logical check on t for u(t). Should be extendable to a shifted step fu...

oltre 3 anni fa | 0

Risposto
How Do I Determine which Group Variables Correspond to the Results of SplitApply
Consider using the second argument output from findgroups? [G,ID] = findgroups(A) also returns the unique values for each group...

oltre 3 anni fa | 0

| accettato

Risposto
Incorporate Incremental Vector into an Equation
Use the elementwise operators (preceed divide/multiply with a dot). https://www.mathworks.com/help/matlab/matlab_prog/array-vs-...

oltre 3 anni fa | 0

Risposto
count of non zero elements of a row vector in a loop
Try the nnz function. It sounds like you're trying to count the number of nonzero elements in each row? Use arrayfun to apply t...

oltre 3 anni fa | 1

| accettato

Risposto
Using CLEAR ALL usually decreases code performance and is often unnecessary
It sounds like you're seeing this in the Editor's Linter coding tips? These are all "clear the slate" commands, Use clc to clea...

oltre 3 anni fa | 1

Risposto
Can I use boolean of a variable on a column of another variable
Hi, to confirm/rephrase, you're looking to extract 16 separate arrays, each one corresponding to the case where the response mat...

oltre 3 anni fa | 0

Risposto
How To Assign Operator/Variables with a value
I'm not familiar with LGP. Consider a cell array to hold the chromosome? C = {X, 2, @times, 4} Using the operator definition...

oltre 3 anni fa | 0

Risposto
Creating a vector from recursive elements of another vector
Welcome to MATLAB! Matlab will allocate the memory for you on the fly, so this is a one line operation, no need for a loop :) ...

oltre 3 anni fa | 0

| accettato

Risposto
i need to convert data from hourly data to daily data and plot these data
Import using a timetable. https://www.mathworks.com/help/matlab/timetables.html Decide how you want to decimate the data in col...

oltre 3 anni fa | 0

Risposto
Passing parameters to dde23 slows it down
Anonymous functions carry some overhead. I wonder if the way it's parsing the arguments to dde23 is causing it to rebuild the an...

oltre 3 anni fa | 0

Risposto
Concatenate fields of a structure into a matrix
Long-term, it sounds like you might want to consider a different data structure, if that's an option. In the interim, try cell2...

oltre 3 anni fa | 0

Risposto
Error in Integrator is not finite. How can I fix it?
Since this happens at t=0, are you possibly dividing the block's input along the way by something that could be zero on simulati...

oltre 3 anni fa | 0

Risposto
Viewing figure is not possible.
matplotlib takes an explicit "show" command. Try: py.matplotlib.pyplot.show()

oltre 3 anni fa | 1

Risposto
Messagebox warning in matlab
The NCC return value you're getting back is a matrix of correlation values (for Lena, it's 512x512). The string you're passing t...

oltre 3 anni fa | 0

| accettato

Risposto
Printing outputs when running C code in simulink via the coder.ceval function
Not completely sure about this one, but if there is there a way to access the Simulink diagnostics panel from within the C code,...

oltre 3 anni fa | 1

Risposto
save animation ,i need help
Sofiane, Take a look at the VideoWriter and getFrame functions: https://www.mathworks.com/help/matlab/ref/videowriter.html Sp...

oltre 3 anni fa | 0

Risposto
I got this error while running a simulink model
You generally get this error when your simulation has an error that causes one of the states to grow exponentially until one of ...

oltre 3 anni fa | 0

Risposto
Loading and saving variables when using parallel toolbox
File access with parallel workers can be tricky, and in the past I've been successful by creating a separate temp directory per ...

oltre 3 anni fa | 1

| accettato

Risposto
How do I highlight very faint lines from an image?
Have you tried the Hough transform? https://www.mathworks.com/help/images/ref/houghlines.html

oltre 3 anni fa | 0

Risposto
Plot variables with similar names.
Are they already saved variables? If not, can you assign using a cell format instead? The mapping would look something like: v...

oltre 3 anni fa | 0

Risposto
Associate Map container with specific values
Map containers are a type of hash object, but not all MATLAB datatypes are hashable. The keys of containers are limited to a sub...

oltre 3 anni fa | 0

Risposto
How can I plot in dB in Matlab?
Decibels are a ratiometric measurement. For power, as shown in your plot, the reference is 1 milliwatt (denoted from the dBm). 0...

oltre 3 anni fa | 0

Risposto
Does this variable exist
For structures, use isfield() clear a a.M = 'hat'; isfield(a,'M') % True isfield(a,'N') % False For array size, use length(...

oltre 3 anni fa | 0

Risposto
Making the if statement in a for loop display only one iteration of the message
Looks like it takes 25 iterations to converge. Are you looking for it to display at the very end a Success/Failure message? The...

oltre 3 anni fa | 0

Carica altro