Answered
Subtracting matrices by column
bsxfun(@minus,A,B)

14 years ago | 0

Answered
Error using rmdir
Maybe you need to run rehash() after executing rmdir().

14 years ago | 0

| accepted

Answered
calculation with numbers with maximum 3 nonzero digits gives a result with more then 3 nonzero digits
This is the limitation of using limited number of binary numbers to represent a real-word value. Even with double precision (8 b...

14 years ago | 0

| accepted

Answered
Separate numerical and txt string into two different strings
You are close. M_b = '1000 km'; M_b1 = textscan(M_b,'%f')

14 years ago | 0

Answered
Discrete time nonlinear system
Grab an Integrator block, if the input is dx1/dt, then the output is x1. Do the same for x2 and then you have all you need to bu...

14 years ago | 0

| accepted

Answered
Inserting Variable NAME into plot title
use inputname()

14 years ago | 0

| accepted

Answered
Binary Bit Masking
bitand(), bitor(),

14 years ago | 0

| accepted

Answered
CAT arguments dimensions are not consistent.
To combine the variables A,b,C,d,E,f and zeros(1,n+1) into one matrix using [ A b ; C d ; E f ; zeros(1,n+1) ], they need to be ...

14 years ago | 0

Answered
Steady state?
Typically, the results of a simulation represent the transient or dynamic response of the model under the stimulus of inputs and...

14 years ago | 0

| accepted

Answered
getting distance between each of the meshgrid point from predefined points in the plot
The problem is at your inner loop of k. As of now, dist(i,j) is re-set at every iteration of k so the result is the same as for ...

14 years ago | 0

Answered
Dealing with multiline text
In fact, it is quite inconvenient to create a multiline text string in MATLAB. I've tried the first approach as below before. Bu...

14 years ago | 5

| accepted

Answered
"Bytes" is 0 in Variable Editor
If you do a=struct() or b=[], you will see that the variable a and b have been declared but not assigned value. Thus, a and b ha...

14 years ago | 1

| accepted

Answered
writing to an array
If you want to assign the value of the vector or matrix "a" to a particular column of the matrix variable "A", then A(:,Column...

14 years ago | 0

Answered
adding matrices inside a big matrix
Because the size of your matrix, you might want to re-use the matrix so replace the variable "e" and "f" with "d". %% d=...

14 years ago | 1

Answered
Simulink - Times
There are two ways. If you are using sim() to run the simulation, then use [T,X,Y]= sim('model',TIMESPAN,OPTIONS,UT), T(end) wi...

14 years ago | 0

| accepted

Answered
excel files
Show your code and show where you were stuck. xlsread() can read individual sheet. You just need two for-loops nested to rea...

14 years ago | 0

Answered
matrix dividing
A=ones(1,450000); NewA=reshape(A,300,[]); C=B*NewA;

14 years ago | 0

Answered
Switch Case where case is a word_anynumber
Use strfind(), strcmp() or strmatch(). You may also consider use "if-else" rather than 'case-switch" if strfind(StrVariable,'wo...

14 years ago | 0

Answered
Why am I getting this horzcat error? The dimensions are the same(??)
A is text data. It's likely in cell array. newmat is numerical data. It's likely double array. You can't concatenate them di...

14 years ago | 0

Answered
convert Modified Julian Date
You can use datestr(),datenum() and datevec() function. Try this: a=now; b=datestr(a) c=datevec(a) According to Wikipedi...

14 years ago | 1

Answered
how to do implement difference equation in matlab
It might be a filter. But I thought all the assignment was asking you to do is to write a for-loop to generate the y series data...

14 years ago | 0

Answered
how to create a GUI from another GUI?
Yes. This is problematic. I suggest you do this. Run GUIDE, open the old GUI figure, and then save as. Then you can do your m...

14 years ago | 1

| accepted

Answered
Apply logical matrix to dataset
Try this example to see how logical index works. a=magic(3); b=logical([1 0 1;0 1 0; 0 0 1]); c=a(b) It's picking the el...

14 years ago | 0

Answered
manipulation of non numerical matricies
You are right. If you specify the value of those variables such as d,f,r1,r2,r3,m3,a,b,c,e etc. ahead of the matrix A and y, eve...

14 years ago | 0

| accepted

Answered
stop watch in Simulink
Compare the number with the constant 18, it will generate pulse signals based on the value. Feed the signal to an "Integrato...

14 years ago | 0

Answered
Implementig user-define function in Simulink
Yes, you can use Embedded MATLAB function. But if your M-function is already done and you don't need to generate C code for it, ...

14 years ago | 1

| accepted

Answered
Sliding window integrator in matlab code
The key function is conv().

14 years ago | 0

Answered
Can I loop xlsread to open files?
I don't understand your difficulty. The answer to your previous question has shown you how to find all the .csv file in a partic...

14 years ago | 0

| accepted

Answered
plotting trouble
In your for-loop, x and y are assigned a value one at a time. x and y are always over-written. So at the end of the loop, you en...

14 years ago | 1

| accepted

Answered
Need help to specify unique values of a vector
You probably didn't use the function right. find() finds indices of nonzero elements. I don't know why you would run idx=find...

14 years ago | 1

| accepted

Load more