Answered
if/for loop problem
Your inner loop has problem. The variable z is over-written. Probably you meant "for k=0:1:36", instead of "for z=0:1:36"?

15 years ago | 0

| accepted

Answered
Loading Structure from base workspace to embedded matlab
From the documentation, "The Embedded MATLAB Function block accepts inputs of any type that Simulink supports, including fixed-p...

15 years ago | 1

Answered
Simulink very slow when changing configuration/block parameters
No idea. It might be that the computer hardware is no matching for the new software anymore. I have a laptop. It runs R2007b Oka...

15 years ago | 0

Answered
Excel writing Problem: find correct row, write to empty cell
There are still things you didn't clarify. The data in the column "Header", are there multiple lines of file name that contain t...

15 years ago | 1

| accepted

Answered
Parsing a vector
I couldn't resist trying a solution without for-loop. It considered consecutive NaNs. a = [1 3 5 NaN NaN 4.4 5 NaN 8 9]; b=...

15 years ago | 0

Answered
Display the error containing line in .m file
It is usually indicated in the error message. Also, help dbstack.

15 years ago | 0

Answered
Breakpoints
Why do you need that? You can debug by running code line by line (pressing F10).

15 years ago | 0

Answered
excel offset using in matlab question with code in
According to the Excel VB reference, 'Offset' is a property, not a method. But in Excel VB, it seems working like a method, such...

15 years ago | 0

Answered
Compute mean for multiple different length data
To fill the missing data with nan, use the following code. But once you fill it with nan, you won't be able to calculate a meani...

15 years ago | 0

Answered
Matlab list all files in subfolders of the same name...
addpath(genpath(pwd)); which results.txt -all or, function format of which() files=which('results.txt','-all');

15 years ago | 0

Answered
Making a countor map from a excel file
[Num,Txt,Raw]=xlsread('MyData.xls'); x=Num(:,1); y=Num(:,2); z=Num(:,3); contour(x,y,z);

15 years ago | 0

| accepted

Answered
relabel x axis tick marks
set the 'XTickLabel' property of the axes. h=axes; get(h,'XTickLabel') % shows 0 to 1 set(h,'XTickLabel',num2str((1:11)')...

15 years ago | 0

Answered
Simple econometric regression
To use regress(); %% x=(1:100)'; y=10+2*x+rand(100,1); [B,BINT,ErrorTerm]=regress(y,[ones(size(x)),x]); Bet...

15 years ago | 0

Answered
Changing color of Button
Probably this line is the problem: set(handles.b{n},'BackgroundColor',[1 0 0],'Value','Min'); The 'Value' property can't...

15 years ago | 1

| accepted

Answered
Insert multiple txt files, and calculate their mean
# Use a=importdata('TextData.txt') to import your data. # Use mean() to calculate the mean value # Use basic calculation c=a+b...

15 years ago | 0

Answered
Creating legend based on numeric array
legendCell=strcat('N=',strtrim(cellstr(num2str(N')))) Or better for N could be column vector or row vector legendCell=strc...

15 years ago | 1

Answered
Simple econometric regression
You have the right function. Just try it with three return variables. [B,BINT,R] = REGRESS(Y,X) returns a vector R of residu...

15 years ago | 0

Answered
scientific notation
use %g instead of %i. See doc sprintf for more info.

15 years ago | 0

| accepted

Answered
How to implement Battery Model into "for each subsystem" block?
The message is clear. A system with continuous state is not supported in the "For Each" block. What is your use case to implemen...

15 years ago | 0

| accepted

Answered
MATLAB /Simulink Fundamental question
I would think it dependents on the nature of your system. MATLAB is best for solving matrix problem. Simulink is best for solvin...

15 years ago | 0

| accepted

Answered
Adding a subsystem using an m file
You can do that. The easiest way to do is to add your Subsystem block first. add_block('built-in/Subsystem','/Subsystem1')...

15 years ago | 1

| accepted

Answered
conversion of seconds to date
It worked for me. >> t=86400; datestr(t/86400+datenum(2005,1,1)) ans = 02-Jan-2005 >> datestr(t/86400+datenum(2005,1...

15 years ago | 1

| accepted

Answered
Get names of current Simulink block input signal
h_Inports=find_system(SubsystemBlock,'FindAll','On','SearchDepth',1,'BlockType','Inport'); Name_Inports=get(h_Inports,'...

15 years ago | 0

| accepted

Answered
Representing data from File !
Go back to your <http://www.mathworks.com/matlabcentral/answers/11551-scalar-division-and-subtraction previous post>. I saw simi...

15 years ago | 0

| accepted

Answered
out of memory error
Did you pre-allocate RG? The three matrices take about 2G bytes of memory. Do you need keep PC and Acr? If not, there might be a...

15 years ago | 0

| accepted

Answered
Tranfering data from one GUI uitable to another GUI uitable
Why don't you just put the following code in your push button callback function? Assume the tag 'uitable3' is unique. h_uit...

15 years ago | 0

Answered
Getting First Cycle in Simulink
There are different ways to do the initialization. The Outport block has initial value. You can initialize through that. For com...

15 years ago | 0

| accepted

Answered
simulink, switch problem
I am not sure. Maybe you don't need to care about it. It might be floating point number precision thing, such as: >> (0.025...

15 years ago | 1

Answered
Four constant number at different time in Simulink
You can use the solution in <http://www.mathworks.com/matlabcentral/answers/12428-square-pulse-generator-with-varying-amplitude ...

15 years ago | 0

Answered
figure
The 'x^2' is the title of the figure. I don't know why you wouldn't want it. Buy anyway, you can remove it. ezplot('x^2'); ...

15 years ago | 0

Load more