Answered
Importdata; textheader not read completely
Try reading the file data into a string and use the textscan function to retrieve the data you want. filename = '22P04a.csv...

nästan 8 år ago | 0

Answered
Doing operations on a row or a column only in a matrix
Let's assume you have the matrix: Data = [1 96;2 75;3 88;4 30;5 60;6 14;7 88]; with column ordering as specified in your...

nästan 8 år ago | 0

Answered
why i get this error (Undefined function or method 'fptintf' for input arguments of type 'sym'. Error in ==> trying at 34 ;fptintf(fid,' %1.2s\n',r1);)and how to solve it
There's a typo in your code. The line before u = u + 1; must be changed from ; fptintf(fid,' %1.2s\n',r1); t...

nästan 8 år ago | 0

Answered
Sum of all the prime numbers under 100, sum of the ten smallest prime numbers.
Does this help primes_ = primes(100); sum_ = sum(primes_(1:10));

nästan 8 år ago | 0

Answered
program for bool function for prime number in php
You can use Matlab's standard functions "isprime" and "primes". To view the Matlab code for each type "edit FUNCNAME" in the c...

nästan 8 år ago | 0

Answered
Error: Index exceeds matrix dimensions
Ok I downloaded the code and the text file from the website you mentioned. When running the code the rawdata variables has a siz...

nästan 8 år ago | 0

| accepted

Answered
How to create class with no attributes?
In Matlab this class may be created as follows. classdef MyClass methods function myMethod1(this,varargin) ...

nästan 8 år ago | 0

Answered
How to check condition element by element till satisfied
I hope this is what you're looking for: a = ones(5); sz = size(a); a = a(:); count = 0; isDebug = true; %% So you kn...

nästan 8 år ago | 0

| accepted

Answered
Replace elements meeting condition with last valid value
I guess I understand what you want to do. Try this PTEf = [P1;P2]; ETEf = [E1;E2]; ij = PTEf>S(1) | PTEf > S(end); P...

nästan 8 år ago | 0

| accepted

Answered
Trouble opening file with Java to use with PDFBox
Try wrapping your pdfname variable in a java.lang.String variable. This sometimes works: pdfname = java.lang.String('...\ex...

nästan 8 år ago | 1

| accepted

Answered
To delete the empty fields in the dataset
Now, try this V = {1,2,[],[],23,16,'A',struct()}; % your cell array V = V(~cellfun('isempty'),V);

nästan 8 år ago | 0

Answered
How do I plot the plot a line using slope and one (x,y) coordinate on Matlab?
Let's define the slope as m; So using the equation: y = m(x-x1) + y1, we can calculate all values of y corresponding to a partic...

nästan 8 år ago | 5

| accepted

Answered
define function that includes number of variable and call it in many callback function in GUI
Let's assume you have defined these variables. a = 2; b = 7; c = 15; Name = 'My Name'; Age = 105; To make sure that these a...

nästan 8 år ago | 1

| accepted

Answered
How to iterate odd and even runs alternatively?
Let's try. Define variables needed for calculation. x = [NaN,NaN]; t = 1; m = 2; % any value you like. n = -2; % any va...

nästan 8 år ago | 0

Answered
If statement with 2 commands
Ok, I think I see two problems in your if statement. 1). == is not an assignment operation, but rather a comparative one. So ...

nästan 8 år ago | 0

Answered
How to get two adjacent columns in loop
You need not use a for loop for this. rData = DATA(:,2:2:end-1) % Get all the real data col 2,4,6...1022 iData = DATA(:,3:...

ungefär 8 år ago | 1

Answered
How to save certain values in a FOR loop
just before the start of the first for loop, define an empty matrix, this will be the storage for all the valid step-values. Rep...

ungefär 8 år ago | 0

| accepted

Answered
How to display continuous changing values in static text of GUI
I think your code is working fine. Try putting a little time delay before setting the string of handles.text1. Something like, ...

ungefär 8 år ago | 0

Answered
delete element from vector
% Use logical indexing a = a(a~=3)

mer än 8 år ago | 0

Answered
Where can I insert my Operation and How to display the result in Static Text?
Please see the attached files.

ungefär 9 år ago | 0

| accepted

Answered
Can I run a "clear java" command but still keep a variable in the workspace?
I guess you can store those java variables in a structure and run "clear java"; the variables should still be available in the s...

ungefär 9 år ago | 0

Answered
separating x and y from an equation
%% USE regexp to split the string % str = regexprep('2x-3y^2','(\d+)(\w+)','$1*$2'); str = regexprep(str,'(\w+...

ungefär 9 år ago | 0

Answered
How to remove the tic labels but not the marks?
%% To remove tick marks on the y-axis tickMarks = {'YTick',[]}; set(gca,tickMarks{:});

ungefär 9 år ago | 1

Answered
How to remove the tic labels but not the marks?
%% Remove tick labels for the X and Y axes tickCell = {'XTickLabel',{},'YTickLabel',{}}; set(gca,tickCell{...

ungefär 9 år ago | 1

Answered
How do I ignoring '\n' at the end of the text file that was created?
You are appending that extra line. What you can do is change: fprintf(output,'%s\n',line) to fprintf(output,'...

ungefär 9 år ago | 0

| accepted

Answered
selecting file from a database (.txt files) ?
function files = listFiles(key,directory,ext) %% LIST FILES % key : the machine name or day % : if search...

ungefär 9 år ago | 0

| accepted

Answered
selecting file from a database (.txt files) ?
Please see attached file.

ungefär 9 år ago | 0

Answered
How to optimize this code?Please help me and guide me in this direction.
To store matrices in a matrix you need to use a cell array. A cell array is capable of storing any data type. Hence we are first...

ungefär 9 år ago | 0

Answered
Select every Nth row from number groups
a = [1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1]; isTake = false; newMatrix = nan*ones(size(a)); count = 0; for...

ungefär 9 år ago | 0

Answered
How can I create a matrix out of a matrix?
indices = find(any(A,2)); B = [indices A(indices,:)];

ungefär 9 år ago | 1

Load more