Answered
Speeding up writing a very large text file
_"To solve this problem I broke the output into blocks ..."_ What problem? MATLAB has no problem with |fprintf| used on milli...

8 years ago | 3

| accepted

Answered
Plots are overriding each other, and I do not know why
_"Plots are overriding each other, and I do not know why"_ *Summary* Because that is exactly what you are telling MATLAB to d...

8 years ago | 3

| accepted

Answered
Extracting numeric values from character array
This is easy with <https://www.mathworks.com/help/matlab/ref/sscanf.html |sscanf|>: >> coords = ['[ 48. -24. 48.]';'[ 50. ...

8 years ago | 2

| accepted

Answered
How do I create multiple parallel lines
Plotting lots of lines is not the correct solution, you should use the <https://www.mathworks.com/help/matlab/ref/grid.html |gri...

8 years ago | 2

| accepted

Answered
How do I get matlab to list all numbers from 1 to 100 divisible by 6?
Method zero: |colon| and |times|: >> 6.*(1:16) ans = 6 12 18 24 30 36 42 48 54 60 66 72 7...

8 years ago | 4

Answered
Why does pixel index counter stop at 255 and repeat?
Try this: pixcrgb = [1:size(crgb,2); double(crgb)]; ^^^^^^ convert to double! Because |crg...

8 years ago | 0

| accepted

Answered
Dimensions of matrices being concatenated... cell2mat
_"Wtah is can be wrong?"_ The number of rows of all of the matrices are not the same. Take a look at the last one, it has one...

8 years ago | 0

| accepted

Answered
a basic question for a beginner
_"According to what I learned the operation of == should be implemented on the same size subjecs, eg. scalar==scalar or vector==...

8 years ago | 0

| accepted

Answered
addition of two arrays element by element creating matrix
>> A = randi(9,1,5) A = 4 4 6 9 1 >> B = randi(9,1,7) B = 7 9 9 8 8 7 9 >> A(:)+B ...

8 years ago | 1

Answered
Assigning different color in legend
_"How can i assign different color for all of them"_ Each time you call |plot| is independent from the other calls, and so ea...

8 years ago | 0

Answered
How to fit a surface to 3D dta points
Your data are scattered, not gridded: <https://www.mathworks.com/help/matlab/math/overview-of-interpolation-techniques.html> ...

8 years ago | 0

Answered
How can I save each workspace array (hjunc) that iterates in my code?
_"How can I save each workspace array (hjunc) that iterates in my code?"_ Easy, just <https://www.mathworks.com/help/matlab/m...

8 years ago | 0

Answered
how to append different arrays without normalization?
data = [double(i);double(j);double(blksz);double(avg)] or using some suitable integer class which can contain the required ...

8 years ago | 0

| accepted

Answered
Finding sum of a loop
You should always preallocate the output arrays before the |for| loop, which will have two benefits: # improve efficiency. #...

8 years ago | 1

Answered
Smoothing data without using inbuilt functions
Currently your Left and Right loops are superfluous, as each loop iteration does exactly the same thing. But to write a version ...

8 years ago | 0

| accepted

Answered
(Solved) How do I change my t and dVdT to input in a 31x1 double, instead of 1x31 (row to colum)
The loop is pointless anyway, just get rid of it: y = 0:0.1:3; V = 45-5*(3-y).^2; dVdt = [diff(V),0]; t = 0.001*dV...

8 years ago | 1

Answered
All necessary functions have been defined except for tout and omega,
The <https://www.mathworks.com/help/matlab/ref/ode15s.html |ode15s|> help clearly states that its first input must be a <https:/...

8 years ago | 1

| accepted

Answered
Multiple outputs of a single function in a single array
N = 8; C = cell(1,N); for k = 1:N S = xlsread('output',sprintf('sheet%d',k)); C{k} = max(S,[],1).'; end...

8 years ago | 1

| accepted

Answered
Simplifying a for loop
Assuming that |e| is a scalar, you could create the index for |b| using a vector, something like this: for k = ... i...

8 years ago | 0

| accepted

Answered
How do you catalogue/index a matrix to be concatenated into a 3D matrix?
I would recommend following the examples in the MATLAB documentation: <https://www.mathworks.com/help/matlab/import_export/pr...

8 years ago | 0

Answered
"createInputDataset" command is not supported in MATLAB 2016b?
_"This command is not supported in MATLAB 2016b?"_ Scroll to the very bottom of that help page. It says in bold letters: ...

8 years ago | 0

| accepted

Answered
How do I populate a 100 x 100 [A] matrix given rules seen below? Then use spy(A) to show non-zero entries?
*Method one: <https://www.mathworks.com/help/matlab/ref/toeplitz.html |toeplitz|> (simple to resize):* >> V = zeros(1,10); ...

8 years ago | 1

Answered
Error while passing function to matlab's svds function
The <https://www.mathworks.com/help/matlab/ref/svds.html |svds|> help shows that the first input can either be a matrix, or a fu...

8 years ago | 0

| accepted

Answered
Mean of elements across multiple matrices
You don't given any details of the file format or how these matrices are stored, so I have used |csvread| to represent whatever ...

8 years ago | 1

| accepted

Answered
How to replace a portion of data with another
This works. The example input and output files are attached. newData = [1,2;3,4;5,6;7,8]; newName = 'blah.prw'; f...

8 years ago | 0

| accepted

Answered
Check class of input variables
Simply using <https://www.mathworks.com/help/matlab/ref/varargin.html |varargin|>: function out = myFun(varargin) idx = ...

8 years ago | 0

Answered
Why does MATLAB change the values while taking data from a file?
_"Why does MATLAB change the values while taking data from a file?"_ Because those exact values cannot be stored as binary fl...

8 years ago | 3

Answered
Swapping Blocks in a Matrix
>> x = [1,2,3,4,5;6,7,8,9,10;11,12,13,14,15] x = 1 2 3 4 5 6 7 8 9 10 11 12 ...

8 years ago | 1

| accepted

Answered
How can I access the data stored in a 1x16 struct in a .mat file?
S = load('NoDotsAnalyzed.mat'); plot(S.data_dic_save.WhateverFieldYouWantToPlot) You need to know which field/s of the s...

8 years ago | 0

| accepted

Load more