Respondida
How do I get both the minimum of a 2D matrix and it's indices?
minMatrix = min(matrix(:)); [row,col] = find(matrix==minMatrix);

casi 13 años hace | 18

Respondida
How to open .dat file
Use the functional form of load, i.e. load(f)

casi 13 años hace | 0

| aceptada

Respondida
How can shape a matrix with predefined vectors?
N = [N1; N2; N3];

casi 13 años hace | 1

| aceptada

Respondida
XTick Visibility off with XTickLabel showing
set(axes2, 'TickLength', [0 0]);

casi 13 años hace | 1

| aceptada

Respondida
How to avoid for loops when generating index arrays?
It's kind of hack-y, but it gives the same output as your original posting: n=4; l = cell2mat(arrayfun(@(x) x*ones...

casi 13 años hace | 0

Respondida
How can I plot 3D TENT with MATLAB?
For part (a), I would look up the documentation for the following two commands: linspace %to create your x and y domain ve...

casi 13 años hace | 0

Respondida
Loading ascii data file with headers
This should do it fid = fopen('path/to/your/file.txt', 'rt'); Data = textscan(fid, '%d %f %f', 'headerLines', 3, 'Collec...

casi 13 años hace | 0

| aceptada

Respondida
Save While-loop to vector
Make your variables into vectors, by indexing through them: index = 1; while Velocity2(index) >=-20 Velocity2(...

casi 13 años hace | 2

Respondida
Extract Information Between M-Files
It depends how the m-files are defined. If they are scripts (that is, they are not defined by the 'function' keyword at the top)...

casi 13 años hace | 0

| aceptada

Respondida
Pixel Selection within a GUI
Easiest (although not particularly clean) way might be to use ginput(), and then round the return coordinates to select the pixe...

casi 13 años hace | 0

Respondida
How can I clear a graph before drawing a new one?
To clear the existing plot first: cla(gca); ezplot(...); To draw a plot in a new window: figure(); ezplot(.......

casi 13 años hace | 0

Respondida
compare two datasets of unequal length and create a textfile
To read in the text files: doc dlmread To compare which dates occur in both files: doc intersect (The second o...

casi 13 años hace | 1

| aceptada

Respondida
Need help plotting 100 Strings onto grid (FOR loop not working)!
I would use a text() function rather than a textbox annotation, since the former is a lot lighter than the latter. You ca...

casi 13 años hace | 0

Respondida
I can't make A<B, it gives me 'lt' error
Hmmm...I don't see any 'sym' variables here. What is the class() of J and P?

casi 13 años hace | 0

Respondida
i have written this code i want to solve this heat equation for n vary from 0 to n(any value) for each value of x at each case from t= 0 to 10
Do you want to evaluate this numerically? Such that you have a value for T at each x and t. If so, your approach of using symsu...

casi 13 años hace | 0

Respondida
Adding points onto a 3D figure in a GUI
Turn 'hold on', and then call plot3() to plot the points.

casi 13 años hace | 0

Respondida
how can I read eeg signal manually ?
A quick Google search indicated this: <http://sccn.ucsd.edu/eeglab/> Apparently, this eeglab toolbox allows for import/manip...

casi 13 años hace | 0

Respondida
How can I create a plot of a 3D mesh given node coordinates and element connectivity from an input file?
Hi Kirsten, First of all, can you clarify exactly what you are trying to plot? For the element connectivity you can define it...

casi 13 años hace | 0

Respondida
Identify and Obtain information from data files
To read the numeric values, I would use textscan() with the 'CommentStyle' option, such as: str = fileread('/your/file/name...

casi 13 años hace | 1

Respondida
finding the string from the text file
To get you started, look at the documentation for the following functions: doc strfind %to find whether a string is pres...

casi 13 años hace | 1

Respondida
Saving a figure with multiple graphs
saveas() takes a figure handle. The output of a plot() command is a line handle (or a 2x1 vector of line handles, as you have it...

casi 13 años hace | 0

Respondida
To change Current Folder to the folder of .m File
cd(which(fileparts('/path/to/your/file.m')))

casi 13 años hace | 0

Respondida
Trying to make loop that stops when xnew is closer to xlast by .001
If you could format your code using the 'Code' button above, that would help us read it. That said, I think the problem is in y...

casi 13 años hace | 0

Respondida
Calculating (optimizing?) center of a sphere from surface points?
Here's one function that was developed to do this: <http://www.mathworks.com/matlabcentral/fileexchange/34129-sphere-fit-leas...

casi 13 años hace | 0

| aceptada

Respondida
Adding up words in matrices on Matlab
Another approach might be to use ismember(). For example: dictionary = {'hello', 'my', 'name', 'is', 'kevin', 'susan'}; %w...

casi 13 años hace | 0

Respondida
Will someone help me with a script I am writing to create a video from multiple pictures
The major issue that I see if that you are calling image() with a size, rather than the actual data (rgb). Try this: vidO...

casi 13 años hace | 0

| aceptada

Respondida
convert an array of numbers into letters; 1 =a, 2 =b, 3 = c etc.
Alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' numbers = [3,6,12,1,1,3] letters = Alphabet(numbers) Or using the ASCII...

casi 13 años hace | 5

| aceptada

Respondida
how can i read or open a .img file using Matlab?
I've never used it, but a quick search of the Help gave: doc hdrread

casi 13 años hace | 0

Respondida
How to inverse all vectors in a struct
Structure= structfun(@fliplr, Structure, 'UniformOutput', false)

casi 13 años hace | 1

Respondida
Split a matrix into a sum of other matrices
How is your matrix currently defined? Are you really combining both numeric elements (e.g. doubles) and symbolic elements (creat...

casi 13 años hace | 0

Cargar más