Answered
Plotting colorbar of heatmap in logarithmic scale.
The following discussion perfectly answers your question: <https://www.mathworks.com/matlabcentral/answers/100066-how-do-i-cr...

8 years ago | 1

Answered
How can I add zeros above the numbers I created with this code?
Try this: rows=10; for i=1:rows fprintf('%d ',[1:i zeros(1,rows-1)]); fprintf('\n'); end

8 years ago | 1

| accepted

Answered
How to solve this error "Each physical network must be connected to exactly one Solver Configuration block."?
Generally, *Solver Configuration* blocks are inserted to the reference point of the model, in this case, which is your _electric...

8 years ago | 0

Answered
How to code to get this output
Do not *dynamically create variables*. It is not recommended. Instead, use a _multidimensional array_: for m=1:25 xt(...

8 years ago | 0

Answered
could anyone help me to fix the issue
N_rng={[ 1 2 3 4 5 23];[6 7 8 9 10 25 26];[11 12 13 14 15 16 17]} for i=1:size(N_rng,1) N_rng{i,:} .. end

8 years ago | 0

Answered
can anyone help me to fix the issue
v={[1 2 3 4];[5 6 7 8 9];[10 11 12 13 14 15]}; for i=1:size(v,1) v{i,:} end

8 years ago | 0

| accepted

Answered
I know in matlab, index start from 1, not 0; How come I get an error on line k1 saying index exceeds matrix dimension even though for loop starts from 2?
Because you did not do any *preallocation* for k1, k2, k3 and k4. Add this code before your loop and after the definition of _st...

8 years ago | 0

| accepted

Answered
Making the derivative the subject of an equation
Yes, you can. syms Van(ia(t)) Sa Sb Sc Vdc r l eq=...%your eq goes here Deq=diff(Van,ia)

8 years ago | 0

Answered
Data type mismatch-Compare To Zero' is a signal of data type 'boolean'. However, it is driving a signal of data type 'double'.
Use a *Data Type Conversion* block to put it in front of your _Compare To Zero_ block to convert the data type to *double*.

8 years ago | 0

Answered
How can I use ginput in app designer?
You can't. If you check the documentation of *ginput*, you will see it can not take a predefined axes as an input argument: <...

8 years ago | 1

Answered
How to initialize start values for variables and then overwrite in simulink
You can initialize values in Simulink by using *File->Model Properties->Model Properties->Callbacks->PreLoadFcn* or *InitFcn*. T...

8 years ago | 0

| accepted

Answered
beginner: writing a function to caculate sum
The purpose of using *Symbolic Toolbox* and *symsum* function in this case is to *get rid of a for loop* and do all the necessar...

8 years ago | 0

Answered
convert array in simulink to a time block
The workaround of this problem is to use *From Workspace* block and provide a time column to the data. Go to *File->Model Proper...

8 years ago | 0

Answered
Filtering a very noisy signal
Try the following code. Fistly, by the help of *psd* function, I observed your data's frequency plot to see at what frequencies ...

8 years ago | 2

| accepted

Answered
How can I replace value of specific cell value depending on another matrix?
D_modified=A(all(ismember(A(:,1:2),D(:,1:2)),2),:)

8 years ago | 0

| accepted

Answered
How do i get to store all the duplicate variables having different values in an array in matlab?
Something like this? Name={'a','a','a','b','b','c','a','a'}.' Value=randi([1 7],size(Name,1),1) Tab=table(Name,Va...

8 years ago | 0

Answered
Unable to simulate a problem in simulink that runs effortlessly in Python.
For algebraic loop errors, simply add a *Delay* block to where the feedback occurs. This should solve it.

8 years ago | 0

Answered
While looping running too many times
Change the following lines x = num2str(c(i,1)); fprintf('the %d variable is %d\n',i,x) to x = string(c(i,1)); ...

8 years ago | 0

| accepted

Answered
How to apply runge kutta method for system of equations that are coupled ODE's? like x1'= -3*x2 and x2'=(1/3)*x1? I tried the code below but get an error on function define saying too may input arguments.
In all of your _for loop_, even though your *Fx1* and *Gx2* functions are defined for one input argument, you try to pass *two i...

8 years ago | 0

| accepted

Answered
variable size of simulink matlab function
Run the attached model. What you basically needed to do is to go to *Model Explorer* and set the output of the MATLAB Function a...

8 years ago | 1

| accepted

Answered
how to swap input interfaces with each other without using switch or if block?
Use a *MATLAB Function* block. You will be writing *if else if* or *switch* statements as if you were writing it on MATLAB comma...

8 years ago | 0

| accepted

Answered
How to convert the contents of a cell array into specific numbers?
Assuming that _Inputs_ is a *cell array*: inputs={'73','t2b';'59','t1c';'58','t3b';'78','t3b'} wanted_outputs=regexprep(i...

8 years ago | 1

Answered
select corresponding values out of different columns of a matrix
vals=trialList(find(trialList(:,5)==1),[5 14]);

8 years ago | 0

| accepted

Answered
Multiple variables in for loop
Something like this? a=[11,51,101] %preallocation E=zeros(1,numel(a)); H=zeros(1,numel(a)); Toplam=0 x=pi/...

8 years ago | 0

Answered
How do i plot simulink signal graph (simscope) on matlab 2016 workspace
Use a *To Workspace* block to log your signal. Set its *Save format* to *Structure with time* and name it as *ScopeData*. Then, ...

8 years ago | 1

| accepted

Answered
Submatrix Display simple function
A(3:5,2:6) or disp(A(3:5,2:6))

8 years ago | 0

Answered
Simulink - Initial condition for first iteration only
Run the attached model. I simply made a logic where the clock of the simulation is compared to a constant, let's say your sampli...

8 years ago | 0

Answered
Matlab Function Block ode45 solver Event option
To solve this problem, do this: Click on your MATLAB Function in your model once and while it is selected, click *Ctrl+H* to ...

8 years ago | 0

Answered
The following error occurred converting from sym to double: Unable to convert expression into double array."
There are few things that does not add up to me in your function: First, you pass *q* as input argument and then you assign i...

8 years ago | 0

| accepted

Load more