Answered
Variable not advancing as told to
_"...when i changes to 3, j should change to 3 as well but it's not happening"_ Looks like perfect place to use debugger to s...

10 years ago | 0

Answered
Random but unique values in matrix
>> z=randi([0 1],100,13); % Generate trial array >> [u,ia,ib]=unique(z,'rows','stable'); % check for uniqueness between r...

10 years ago | 1

| accepted

Answered
How to make output of a function available to script without function call?
[f1, f2] = function myFun(X,Y) You're missing the second output in the function definition. Without it, there's no way oth...

10 years ago | 0

Answered
how can I store values generated from a nested loop into an arrray ?
Create independent index variables and increment them each pass thru the loop... "The Matlab way" would be to use the vectori...

10 years ago | 0

Answered
How do I plot intensity of points on a scatter plot?
Nuthin' to it...try x=randn(100,1);y=randn(100,1); % sample data scatter(x,y,20*abs(y),y,'filled') colormap(hsv) ...

10 years ago | 0

Answered
Find first non-zero column of a matrix
>> A=[zeros(5) randn(5)]; A=A(:,randperm(10)); % sample dataset A = -0.7440 1.0223 0 -0.7062 0 0.1257 ...

10 years ago | 2

| accepted

Answered
extracting values from text files as matrix format
I'll presume you'll also want to know the week number... >> fid=fopen('semet.txt','r'); >> fmt1='%*s Week %f'; fmt...

10 years ago | 0

Answered
I have a excel sheet and 1st column contains more than 1000 data. how do i put those data into 10, [] matrix and write in to txt file. Thanks
x=xlsread('yourspreadsheet.xls'); csvwrite('youroutputtextfile.csv',reshape(x,10,[]); Of course, if *mod(length(x),10)~=...

10 years ago | 1

Answered
hello, i have monthly electricity demand for a year each month have just min and max vkues so for the whole year I have 24 vlues (min and max per month)?
About all you can do with that data, lacking even the daily demand what more the hourly, would be to average the weather data on...

10 years ago | 0

| accepted

Answered
fprintf specific column from multiple text files to one csv sheet
_"Error using fprintf. Function is not defined for 'cell' inputs."_ Indeed it isn't; must cast to character array... fid...

10 years ago | 0

| accepted

Answered
Matrix linear indexing: how to add more than once to the same index
>> ix=[1 3 1]; >> A(unique(ix))=A(unique(ix))+histc(ix,unique(ix)) A = 3 3 3 4 >> Keep a ...

10 years ago | 0

Answered
what is the matlab code to remove header section of observation file in RINEX data
Try <https://www.ngs.noaa.gov/gps-toolbox/Borre2.htm>

10 years ago | 0

Answered
Issue with positioning figure legend - should position lower left corner, but actually positions center
Actually, the position is the four-vector Position — Custom location and size four-element vector _[left, bottom, width, height...

10 years ago | 0

Answered
Find value for a specific probability in probplot
Use the resulting output from *fitdist* and then *norminv*... fd=fitdist(vector,'normal'); p50=norminv(0.5,fd.mu,fd.sigma)...

10 years ago | 1

| accepted

Answered
vectorization by rows instead of elements
Well, without your other function, no can say, but M(1) = sqrt(A(1,1)^2 + A(1,2)^2 + ... A(1,n)^2) is simply M=sqrt...

10 years ago | 0

Answered
problem with hold on into a subplot inside a for loop
Several issues here... First, regarding *hold* and its use -- in general it's undesirable to set *hold on* until _after_ the ...

10 years ago | 1

Answered
trimming the first and last elements of a vector
Reassign in place... yhat=yhat(h+1:end-h);

10 years ago | 0

| accepted

Answered
Replacing values in a Matrix
A(A==yourvalue)=NewValue;

10 years ago | 9

Answered
Replacing the Maximum Element per Row of a Matrix with a Different Element
>> x=randi(20,4) x = 15 19 15 14 6 9 14 4 9 20 11 3 11 7 14 20 ...

10 years ago | 0

Answered
Double into Matrix of its Digits
Did you try it and see??? >> num2str(123) ans = 123 >> whos ans Name Size Bytes Class Att...

10 years ago | 0

Answered
How can I Read specific parts(formatted) of an unformatted text file?
Just read and ignore 'til you find the specific stuff looking for...*regexp* can do this or you can just read and test... f...

10 years ago | 0

| accepted

Answered
I can't read my .txt file using importdata. Problem with format?
OK, with the files you can do a file compare and see the difference-- C:\ML_R2012b\work\updated.txt - c:\ML_R2012b\wo...

10 years ago | 0

| accepted

Answered
Decimal places when multiplying by 1.1
Welcome to the wonderful, exciting and often wacky world of floating point arithmetic! >> 90*1.1-99 ans = 1.4211e-14 >...

10 years ago | 1

| accepted

Answered
What is missing from MATLAB?
IA's recent comment on axes and a small farm task to solve for boundaries of a field location to locate a line such that the sub...

10 years ago | 1

Answered
hi , my result show as following 1.3204e-05 , i need show it as numerical value
1.3204e-05 _is_ a numerical value, if you want a specific format other than default look at doc format to make the chang...

10 years ago | 0

| accepted

Answered
how to plot point with marker like a dart
See doc feather

10 years ago | 0

| accepted

Answered
Reduce comuting time: can I change a triple for-loop to a matrix formula?
For starters, carrying on from Sean's point, [r,c,p]=size(temp); % get size meanrs=zeros(r,c,p/12); % mod(p,12)-...

10 years ago | 0

Answered
how to plot multiple plots on one figure
I don't have it to be able to test, but most of your problem is _probably_ related to the fact you have two axes, not just one; ...

10 years ago | 0

Answered
Extracting an individual string from an array of strings and using it to open a text file...
_"Any advice?"_ Sure...simplify, simplify...!!! :) path = ['C:\Users\myname\Documents\Full Sweep']; files = dir(fu...

10 years ago | 0

Load more