Answered
Count the number of times a value occurs in a specific of an array
Try the following to find the number of times '2' occurs in the second row length(find(A(2,:)==2))

12 years ago | 1

Answered
Close message box if user doesn't
There may be a couple of solutions to this. The first is the <http://www.mathworks.com/help/matlab/ref/ishandle.html ishandle> ...

12 years ago | 1

| accepted

Answered
code gives me a false values?
There is no need for a *for* loop (and I don't think that it is working as you expect anyway). Step through the code to see why...

12 years ago | 0

| accepted

Answered
Using an external function in GUI closes the interface
The *heart_rate* function, if like that in the above link, has as its first line close all; clc;clear all; Calling *close...

12 years ago | 0

| accepted

Answered
Value of J in DFT
*j* (along with *i*) is the imaginary unit. In the Command Window, type >> j ans = 0.0000 + 1.0000i See <htt...

12 years ago | 0

| accepted

Answered
Matlab, how to know time step size in the plot or how can i get the output of time step size?
Just after your code executes [t,x]= ode23s(@no,tspan,x0,options); add tDiffs = diff(t); which will return the di...

12 years ago | 0

Answered
Counting black and white pixels
It is line 33 of the attached file that is causing the problem message = sprintf('Done!\nTotal number of pixels = %d\nBlack ...

12 years ago | 0

| accepted

Answered
How to use a for loop to display zeros of a function
You've almost have it. The problem is that the code is overwriting each index whenever a zero (of f) is found rather than savin...

12 years ago | 0

| accepted

Answered
Index exceeds matrix dimensions using pca in matlab 2013a
Your code assumes that there are 50 columns in *evectors*. Why? With the debugger, prior to evaluating evectors = evectors...

12 years ago | 0

Answered
Why am I getting "Subscripted assignment dimension mismatch" for this code
The *val* matrix has 10000 rows and one column. I suspect that at the third line of code, more than one value is being read fro...

12 years ago | 0

Answered
Intersection of circle chords
Sean - rather than pasting 80+ lines of code in your question, it would be better to just attach it the m file to your question ...

12 years ago | 0

| accepted

Answered
Problem to recover data from bit stream
The use of *reshape* is causing the problem. Is there a reason why this is being used? After you have read in the data (fr...

12 years ago | 0

Answered
How do I update a listbox with the strings which I enter using a inputdlg command? I tried the same, but when I enter the second string, the first string gets replaced by the new one.
All you need to do is append the new string to the existing list % prompt the user for some input answer = inputdlg(prompt...

12 years ago | 1

| accepted

Answered
reading multiple excel files in matlab
Matt - You are pretty close to having the correct solution. The use of the cell array is a good idea for storing the data (as e...

12 years ago | 0

| accepted

Answered
How to read a string data from excel sheet ? Or to read a single row having charaters
Consider using *xlsread*. See <http://www.mathworks.com/help/matlab/ref/xlsread.html xlsread> for details and pay particular att...

12 years ago | 2

| accepted

Answered
GUI- "Attempt to reference field of non-structure array." Error with varargout and using red x to close
I launched the GUI (through GUIDE) and observed the same results as you - when I pressed the close button (x), the error message...

12 years ago | 0

| accepted

Answered
Iteratively loop for computing (WHILE)
Since *Xo*, *Yo*, *Zo*, and *To* represent the approximate position and the code refines/corrects the position to *Xa*, *Ya*, *Z...

12 years ago | 0

| accepted

Answered
How to control a push button?
I'll assume that you are using GUIDE to build your GUI. Suppose that you have two push buttons named *pushbutton1* and *push...

12 years ago | 2

Answered
Auto attach file that I created with xlswrite?
Since the data has been saved to a file with the name of *name_xls* (presumably within the current directory), then rather than ...

12 years ago | 0

| accepted

Answered
Display String Arrays in a Listbox
If you want to load a listbox with the contents of 9 string arrays, then (assuming you are using GUIDE to build your GUI) you ca...

12 years ago | 0

| accepted

Answered
help with getfield command
In the above, you state that _The struct is 1 by 4.._ which implies that *stocks* is a 1x4 array of (stock) structs. If that is...

12 years ago | 0

Answered
Why options are not working in fracfract function?
In the function signature and after the *GEN* input, each new input is a name/value pair - 'PARAM1',val1, 'PARAM2',val2, etc. T...

12 years ago | 0

Answered
error: expected constructor, destructor, or type conversion before '(' token?
Try including two underscores in front of *declspec* #define DLLEXPORT __declspec(dllexport)

12 years ago | 0

Solved


Sorted highest to lowest?
Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

12 years ago

Solved


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

12 years ago

Solved


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

12 years ago

Answered
symbols in axes titles in .fig
Adding text with symbols to an axes on the GUI is no different than when you create a figure through an m file. For example, ...

12 years ago | 1

Answered
kronecker product by number of iteration
Unless you are looking for a way to do this in one line of code, a simple *for* loop would do the trick A = [1 2;3 4]; B...

12 years ago | 0

| accepted

Answered
problems retreiving realtime data V3 bloomberg
There is an additional bracket in your line of code [subs,t] = realtime(c,{'IBM US Equity','F US Equity'}), ... {'L...

12 years ago | 0

| accepted

Answered
how to subtract the numeric data stored in two files
Consider using <http://www.mathworks.com/help/matlab/ref/dlmread.html dlmread> which will allow you to read the numeric data fro...

12 years ago | 0

| accepted

Load more